From f286498540d0cddb6fcfc4dfa32d552e343b1fe1 Mon Sep 17 00:00:00 2001 From: "chris.watts90@outlook.com" Date: Fri, 18 Oct 2019 09:27:27 +0100 Subject: [PATCH] unknown formatting changes? --- .../DisplayTemplates/ApiGroup.cshtml | 54 ++-- .../DisplayTemplates/HelpPageApiModel.cshtml | 96 +++---- .../DisplayTemplates/Parameters.cshtml | 108 +++---- .../DisplayTemplates/Samples.cshtml | 72 ++--- .../HelpPage.css | 268 +++++++++--------- .../DalSoft.WebApi.HelpPage.Views/api.cshtml | 56 ++-- .../index.cshtml | 86 +++--- 7 files changed, 370 insertions(+), 370 deletions(-) diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/DisplayTemplates/ApiGroup.cshtml b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/DisplayTemplates/ApiGroup.cshtml index 7cfdde8..b3e3a8a 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/DisplayTemplates/ApiGroup.cshtml +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/DisplayTemplates/ApiGroup.cshtml @@ -1,28 +1,28 @@ -@using System.Web.Http.Description -@using DalSoft.WebApi.HelpPage -@model IGrouping - -

@Model.Key

- - - - - - @foreach (var api in Model) - { - - - - - } - +@using System.Web.Http.Description +@using DalSoft.WebApi.HelpPage +@model IGrouping + +

@Model.Key

+
APIDescription
@api.HttpMethod.Method @api.RelativePath - @if (api.Documentation !=null) - { -

@api.Documentation

- } - else - { -

No documentation available.

- } -
+ + + + + @foreach (var api in Model) + { + + + + + } +
APIDescription
@api.HttpMethod.Method @api.RelativePath + @if (api.Documentation !=null) + { +

@api.Documentation

+ } + else + { +

No documentation available.

+ } +
\ No newline at end of file diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/DisplayTemplates/HelpPageApiModel.cshtml b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/DisplayTemplates/HelpPageApiModel.cshtml index 37bb2eb..435629c 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/DisplayTemplates/HelpPageApiModel.cshtml +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/DisplayTemplates/HelpPageApiModel.cshtml @@ -1,49 +1,49 @@ -@using System.Collections.Generic -@using System.Net.Http.Headers -@using DalSoft.WebApi.HelpPage.Models - -@model HelpPageApiModel - -@{ - var description = Model.ApiDescription; - var hasParameters = description.ParameterDescriptions.Count > 0; - var hasRequestSamples = Model.SampleRequests.Count > 0; - var hasResponseSamples = Model.SampleResponses.Count > 0; -} -

@description.HttpMethod.Method @description.RelativePath

-
- @{ - if (description.Documentation != null) - { -

@description.Documentation

- } - else - { -

No documentation available.

- } - - if (hasParameters || hasRequestSamples) - { -

Request Information

- if (hasParameters) - { -

Parameters

- @Include("Parameters.cshtml", Model, typeof(HelpPageApiModel)) - } - if (hasRequestSamples) - { -

Request body formats

- var ModelSamples = Model.SampleRequests; - @Include("Samples.cshtml", ModelSamples, typeof(IDictionary)) - } - } - - if (hasResponseSamples) - { -

Response Information

-

Response body formats

- var ModelSamples = Model.SampleResponses; - @Include("Samples.cshtml", ModelSamples, typeof(IDictionary)) - } -} +@using System.Collections.Generic +@using System.Net.Http.Headers +@using DalSoft.WebApi.HelpPage.Models + +@model HelpPageApiModel + +@{ + var description = Model.ApiDescription; + var hasParameters = description.ParameterDescriptions.Count > 0; + var hasRequestSamples = Model.SampleRequests.Count > 0; + var hasResponseSamples = Model.SampleResponses.Count > 0; +} +

@description.HttpMethod.Method @description.RelativePath

+
+ @{ + if (description.Documentation != null) + { +

@description.Documentation

+ } + else + { +

No documentation available.

+ } + + if (hasParameters || hasRequestSamples) + { +

Request Information

+ if (hasParameters) + { +

Parameters

+ @Include("Parameters.cshtml", Model, typeof(HelpPageApiModel)) + } + if (hasRequestSamples) + { +

Request body formats

+ var ModelSamples = Model.SampleRequests; + @Include("Samples.cshtml", ModelSamples, typeof(IDictionary)) + } + } + + if (hasResponseSamples) + { +

Response Information

+

Response body formats

+ var ModelSamples = Model.SampleResponses; + @Include("Samples.cshtml", ModelSamples, typeof(IDictionary)) + } +}
\ No newline at end of file diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/DisplayTemplates/Parameters.cshtml b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/DisplayTemplates/Parameters.cshtml index 1a45b7c..90f8461 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/DisplayTemplates/Parameters.cshtml +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/DisplayTemplates/Parameters.cshtml @@ -1,55 +1,55 @@ -@using System.Collections.ObjectModel -@using System.Threading -@using System.Web.Http.Description - -@{ Collection parameters = Model.ApiDescription.ParameterDescriptions; } -@if (parameters.Count > 0) -{ - - - - - - @{ - foreach (ApiParameterDescription parameter in parameters) - { - var parameterDocumentation = parameter.Documentation ?? "No documentation available."; - - // Don't show CancellationToken because it's a special parameter - if (!typeof (CancellationToken).IsAssignableFrom(parameter.ParameterDescriptor.ParameterType)) - { - - - - - - } - } - } - -
NameDescriptionAdditional information
@parameter.Name -

@parameterDocumentation

-
- @{ - switch (parameter.Source) - { - case ApiParameterSource.FromBody: -

Define this parameter in the request body. -

- break; - case ApiParameterSource.FromUri: -

Define this parameter in the request URI. -

- break; - case ApiParameterSource.Unknown: - default: -

None.

- break; - } - } -
-} -else -{ -

None.

+@using System.Collections.ObjectModel +@using System.Threading +@using System.Web.Http.Description + +@{ Collection parameters = Model.ApiDescription.ParameterDescriptions; } +@if (parameters.Count > 0) +{ + + + + + + @{ + foreach (ApiParameterDescription parameter in parameters) + { + var parameterDocumentation = parameter.Documentation ?? "No documentation available."; + + // Don't show CancellationToken because it's a special parameter + if (!typeof (CancellationToken).IsAssignableFrom(parameter.ParameterDescriptor.ParameterType)) + { + + + + + + } + } + } + +
NameDescriptionAdditional information
@parameter.Name +

@parameterDocumentation

+
+ @{ + switch (parameter.Source) + { + case ApiParameterSource.FromBody: +

Define this parameter in the request body. +

+ break; + case ApiParameterSource.FromUri: +

Define this parameter in the request URI. +

+ break; + case ApiParameterSource.Unknown: + default: +

None.

+ break; + } + } +
+} +else +{ +

None.

} \ No newline at end of file diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/DisplayTemplates/Samples.cshtml b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/DisplayTemplates/Samples.cshtml index c76f82d..b4d4593 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/DisplayTemplates/Samples.cshtml +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/DisplayTemplates/Samples.cshtml @@ -1,37 +1,37 @@ -@using System.Net.Http.Headers -@using DalSoft.WebApi.HelpPage.SampleGeneration -@model IDictionary - -@{ - // Group the samples into a single tab if they are the same. - var samples = Model.GroupBy(x => x.Value).ToDictionary(x => string.Join(", ", x.Select(m => m.Key.ToString()).ToArray()), x => x.Key); - var mediaTypes = samples.Keys; -} -
- @{ - foreach (var mediaType in mediaTypes) - { -

@mediaType

-
- Sample: - @{ var sample = samples[mediaType]; } - @if (sample == null) - { -

Sample not available.

- } - else if (sample is TextSample) - { -
@(((TextSample)sample).Text)
- } - else if (sample is ImageSample) - { - - } - else if (sample is InvalidSample) - { -
@(((InvalidSample)sample).ErrorMessage)
- } -
- } - } +@using System.Net.Http.Headers +@using DalSoft.WebApi.HelpPage.SampleGeneration +@model IDictionary + +@{ + // Group the samples into a single tab if they are the same. + var samples = Model.GroupBy(x => x.Value).ToDictionary(x => string.Join(", ", x.Select(m => m.Key.ToString()).ToArray()), x => x.Key); + var mediaTypes = samples.Keys; +} +
+ @{ + foreach (var mediaType in mediaTypes) + { +

@mediaType

+
+ Sample: + @{ var sample = samples[mediaType]; } + @if (sample == null) + { +

Sample not available.

+ } + else if (sample is TextSample) + { +
@(((TextSample)sample).Text)
+ } + else if (sample is ImageSample) + { + + } + else if (sample is InvalidSample) + { +
@(((InvalidSample)sample).ErrorMessage)
+ } +
+ } + }
\ No newline at end of file diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/HelpPage.css b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/HelpPage.css index aff2230..488544c 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/HelpPage.css +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/HelpPage.css @@ -1,134 +1,134 @@ -.help-page h1, -.help-page .h1, -.help-page h2, -.help-page .h2, -.help-page h3, -.help-page .h3, -#body.help-page, -.help-page-table th, -.help-page-table pre, -.help-page-table p { - font-family: "Segoe UI Light", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif; -} - -.help-page pre.wrapped { - white-space: -moz-pre-wrap; - white-space: -pre-wrap; - white-space: -o-pre-wrap; - white-space: pre-wrap; -} - -.help-page .warning-message-container { - margin-top: 20px; - padding: 0 10px; - color: #525252; - background: #EFDCA9; - border: 1px solid #CCCCCC; -} - -.help-page-table { - width: 100%; - border-collapse: collapse; - text-align: left; - margin: 0px 0px 20px 0px; - border-top: 1px solid #D4D4D4; -} - -.help-page-table th { - text-align: left; - font-weight: bold; - border-bottom: 1px solid #D4D4D4; - padding: 5px 6px 5px 6px; -} - -.help-page-table td { - border-bottom: 1px solid #D4D4D4; - padding: 10px 8px 10px 8px; - vertical-align: top; -} - -.help-page-table pre, -.help-page-table p { - margin: 0px; - padding: 0px; - font-family: inherit; - font-size: 100%; -} - -.help-page-table tbody tr:hover td { - background-color: #F3F3F3; -} - -.help-page a:hover { - background-color: transparent; -} - -.help-page .sample-header { - border: 2px solid #D4D4D4; - background: #00497E; - color: #FFFFFF; - padding: 8px 15px; - border-bottom: none; - display: inline-block; - margin: 10px 0px 0px 0px; -} - -.help-page .sample-content { - display: block; - border-width: 0; - padding: 15px 20px; - background: #FFFFFF; - border: 2px solid #D4D4D4; - margin: 0px 0px 10px 0px; -} - -.help-page .api-name { - width: 40%; -} - -.help-page .api-documentation { - width: 60%; -} - -.help-page .parameter-name { - width: 20%; -} - -.help-page .parameter-documentation { - width: 40%; -} - -.help-page .parameter-type { - width: 20%; -} - -.help-page .parameter-annotations { - width: 20%; -} - -.help-page h1, -.help-page .h1 { - font-size: 36px; - line-height: normal; -} - -.help-page h2, -.help-page .h2 { - font-size: 24px; -} - -.help-page h3, -.help-page .h3 { - font-size: 20px; -} - -#body.help-page { - font-size: 14px; - line-height: 143%; - color: #333; -} - -.help-page a { - color: #0000EE; - text-decoration: none; -} +.help-page h1, +.help-page .h1, +.help-page h2, +.help-page .h2, +.help-page h3, +.help-page .h3, +#body.help-page, +.help-page-table th, +.help-page-table pre, +.help-page-table p { + font-family: "Segoe UI Light", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif; +} + +.help-page pre.wrapped { + white-space: -moz-pre-wrap; + white-space: -pre-wrap; + white-space: -o-pre-wrap; + white-space: pre-wrap; +} + +.help-page .warning-message-container { + margin-top: 20px; + padding: 0 10px; + color: #525252; + background: #EFDCA9; + border: 1px solid #CCCCCC; +} + +.help-page-table { + width: 100%; + border-collapse: collapse; + text-align: left; + margin: 0px 0px 20px 0px; + border-top: 1px solid #D4D4D4; +} + +.help-page-table th { + text-align: left; + font-weight: bold; + border-bottom: 1px solid #D4D4D4; + padding: 5px 6px 5px 6px; +} + +.help-page-table td { + border-bottom: 1px solid #D4D4D4; + padding: 10px 8px 10px 8px; + vertical-align: top; +} + +.help-page-table pre, +.help-page-table p { + margin: 0px; + padding: 0px; + font-family: inherit; + font-size: 100%; +} + +.help-page-table tbody tr:hover td { + background-color: #F3F3F3; +} + +.help-page a:hover { + background-color: transparent; +} + +.help-page .sample-header { + border: 2px solid #D4D4D4; + background: #00497E; + color: #FFFFFF; + padding: 8px 15px; + border-bottom: none; + display: inline-block; + margin: 10px 0px 0px 0px; +} + +.help-page .sample-content { + display: block; + border-width: 0; + padding: 15px 20px; + background: #FFFFFF; + border: 2px solid #D4D4D4; + margin: 0px 0px 10px 0px; +} + +.help-page .api-name { + width: 40%; +} + +.help-page .api-documentation { + width: 60%; +} + +.help-page .parameter-name { + width: 20%; +} + +.help-page .parameter-documentation { + width: 40%; +} + +.help-page .parameter-type { + width: 20%; +} + +.help-page .parameter-annotations { + width: 20%; +} + +.help-page h1, +.help-page .h1 { + font-size: 36px; + line-height: normal; +} + +.help-page h2, +.help-page .h2 { + font-size: 24px; +} + +.help-page h3, +.help-page .h3 { + font-size: 20px; +} + +#body.help-page { + font-size: 14px; + line-height: 143%; + color: #333; +} + +.help-page a { + color: #0000EE; + text-decoration: none; +} diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/api.cshtml b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/api.cshtml index 8c58cd7..f10b331 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/api.cshtml +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/api.cshtml @@ -1,28 +1,28 @@ -@using DalSoft.WebApi.HelpPage.Models -@model HelpPageApiModel - -@{ - var description = Model.ApiDescription; - var title = description.HttpMethod.Method + " " + description.RelativePath; -} - - - - @title - - - -
- -
- @Include("HelpPageApiModel.cshtml", Model, typeof(HelpPageApiModel)) -
-
- - +@using DalSoft.WebApi.HelpPage.Models +@model HelpPageApiModel + +@{ + var description = Model.ApiDescription; + var title = description.HttpMethod.Method + " " + description.RelativePath; +} + + + + @title + + + +
+ +
+ @Include("HelpPageApiModel.cshtml", Model, typeof(HelpPageApiModel)) +
+
+ + diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/index.cshtml b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/index.cshtml index e4ccb5b..4bf1778 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/index.cshtml +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Help/DalSoft.WebApi.HelpPage.Views/index.cshtml @@ -1,43 +1,43 @@ -@using System.Web.Http.Description -@using System.Collections.ObjectModel -@using System.Linq -@model Collection - -@{ - ViewBag.Title = "ASP.NET Web API Help Page"; - - // Group APIs by controller - ILookup apiGroups = Model.ToLookup(api => api.ActionDescriptor.ControllerDescriptor.ControllerName); -} - - - - @ViewBag.Title - - - -
-
-
-

@ViewBag.Title

-
-
-
-
- -
- @foreach (IGrouping controllerGroup in apiGroups) - { - @Include("ApiGroup.cshtml", controllerGroup, typeof (IGrouping)) - } -
-
- - +@using System.Web.Http.Description +@using System.Collections.ObjectModel +@using System.Linq +@model Collection + +@{ + ViewBag.Title = "ASP.NET Web API Help Page"; + + // Group APIs by controller + ILookup apiGroups = Model.ToLookup(api => api.ActionDescriptor.ControllerDescriptor.ControllerName); +} + + + + @ViewBag.Title + + + +
+
+
+

@ViewBag.Title

+
+
+
+
+ +
+ @foreach (IGrouping controllerGroup in apiGroups) + { + @Include("ApiGroup.cshtml", controllerGroup, typeof (IGrouping)) + } +
+
+ +