Skip to content

Commit d8ce6d9

Browse files
committed
Merge pull request #47 from jordangray/pre
Updates for 2.0.0 pre-release branch
2 parents 61aee58 + d8fa7d9 commit d8ce6d9

File tree

66 files changed

+8153
-4608
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+8153
-4608
lines changed

.vs/config/applicationhost.config

Lines changed: 1027 additions & 0 deletions
Large diffs are not rendered by default.

samples/WebApiContrib.Formatting.Xlsx.Sample/Areas/HelpPage/ApiDescriptionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static string GetFriendlyId(this ApiDescription description)
3131
localPath.Replace("/", "-").Replace("{", String.Empty).Replace("}", String.Empty));
3232
if (queryKeyString != null)
3333
{
34-
friendlyPath.AppendFormat("_{0}", queryKeyString);
34+
friendlyPath.AppendFormat("_{0}", queryKeyString.Replace('.', '-'));
3535
}
3636
return friendlyPath.ToString();
3737
}

samples/WebApiContrib.Formatting.Xlsx.Sample/Areas/HelpPage/HelpPage.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
.help-page .sample-header {
6767
border: 2px solid #D4D4D4;
68-
background: #76B8DB;
68+
background: #00497E;
6969
color: #FFFFFF;
7070
padding: 8px 15px;
7171
border-bottom: none;
@@ -109,6 +109,7 @@
109109
.help-page h1,
110110
.help-page .h1 {
111111
font-size: 36px;
112+
line-height: normal;
112113
}
113114

114115
.help-page h2,
@@ -128,6 +129,6 @@
128129
}
129130

130131
.help-page a {
131-
color: #00abec;
132+
color: #0000EE;
132133
text-decoration: none;
133134
}

samples/WebApiContrib.Formatting.Xlsx.Sample/Areas/HelpPage/HelpPageConfigurationExtensions.cs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
4+
using System.ComponentModel;
45
using System.Diagnostics;
56
using System.Diagnostics.CodeAnalysis;
67
using System.Globalization;
@@ -268,7 +269,28 @@ private static void GenerateUriParameters(HelpPageApiModel apiModel, ModelDescri
268269
complexTypeDescription = typeDescription as ComplexTypeModelDescription;
269270
}
270271

271-
if (complexTypeDescription != null)
272+
// Example:
273+
// [TypeConverter(typeof(PointConverter))]
274+
// public class Point
275+
// {
276+
// public Point(int x, int y)
277+
// {
278+
// X = x;
279+
// Y = y;
280+
// }
281+
// public int X { get; set; }
282+
// public int Y { get; set; }
283+
// }
284+
// Class Point is bindable with a TypeConverter, so Point will be added to UriParameters collection.
285+
//
286+
// public class Point
287+
// {
288+
// public int X { get; set; }
289+
// public int Y { get; set; }
290+
// }
291+
// Regular complex class Point will have properties X and Y added to UriParameters collection.
292+
if (complexTypeDescription != null
293+
&& !IsBindableWithTypeConverter(parameterType))
272294
{
273295
foreach (ParameterDescription uriParameter in complexTypeDescription.Properties)
274296
{
@@ -305,6 +327,16 @@ private static void GenerateUriParameters(HelpPageApiModel apiModel, ModelDescri
305327
}
306328
}
307329

330+
private static bool IsBindableWithTypeConverter(Type parameterType)
331+
{
332+
if (parameterType == null)
333+
{
334+
return false;
335+
}
336+
337+
return TypeDescriptor.GetConverter(parameterType).CanConvertFrom(typeof(string));
338+
}
339+
308340
private static ParameterDescription AddParameterDescription(HelpPageApiModel apiModel,
309341
ApiParameterDescription apiParameter, ModelDescription typeDescription)
310342
{

samples/WebApiContrib.Formatting.Xlsx.Sample/Areas/HelpPage/Views/Shared/_Layout.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width" />

samples/WebApiContrib.Formatting.Xlsx.Sample/Areas/HelpPage/Views/Web.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</configSections>
1010

1111
<system.web.webPages.razor>
12-
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
12+
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
1313
<pages pageBaseType="System.Web.Mvc.WebViewPage">
1414
<namespaces>
1515
<add namespace="System.Web.Mvc" />

0 commit comments

Comments
 (0)