Skip to content

Commit 954026c

Browse files
committed
Aspose.Cells App
1 parent 766d134 commit 954026c

File tree

718 files changed

+71334
-58375
lines changed

Some content is hidden

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

718 files changed

+71334
-58375
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System.Web.Optimization;
2+
3+
namespace Aspose.Cells.API
4+
{
5+
public class BundleConfig
6+
{
7+
// For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862
8+
public static void RegisterBundles(BundleCollection bundles)
9+
{
10+
bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-{version}.js"));
11+
12+
// Use the development version of Modernizr to develop with and learn from. Then, when you're
13+
// ready for production, use the build tool at https://modernizr.com to pick only the tests you need.
14+
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include("~/Scripts/modernizr-*"));
15+
16+
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include("~/Scripts/bootstrap.js"));
17+
18+
bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/bootstrap.css", "~/Content/site.css"));
19+
}
20+
}
21+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System.Web.Mvc;
2+
3+
namespace Aspose.Cells.API
4+
{
5+
public class FilterConfig
6+
{
7+
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
8+
{
9+
filters.Add(new HandleErrorAttribute());
10+
}
11+
}
12+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System.Web.Mvc;
2+
using System.Web.Routing;
3+
4+
namespace Aspose.Cells.API
5+
{
6+
public class RouteConfig
7+
{
8+
public static void RegisterRoutes(RouteCollection routes)
9+
{
10+
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
11+
}
12+
}
13+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System.Web.Http;
2+
3+
namespace Aspose.Cells.API
4+
{
5+
public static class WebApiConfig
6+
{
7+
public static void Register(HttpConfiguration config)
8+
{
9+
// Web API configuration and services
10+
// config.EnableCors();
11+
// Web API routes
12+
config.MapHttpAttributeRoutes();
13+
14+
config.Routes.MapHttpRoute(
15+
"DefaultApi",
16+
"api/{controller}/{action}/{id}",
17+
new {id = RouteParameter.Optional}
18+
);
19+
20+
config.EnableCors();
21+
22+
// Set aspose cells font folder
23+
FontConfigs.SetFontFolder(Config.AppSettings.FontFolderPath, true);
24+
}
25+
}
26+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System.Text;
2+
using System.Web;
3+
using System.Web.Http.Description;
4+
5+
namespace Aspose.Cells.API.Areas.HelpPage
6+
{
7+
public static class ApiDescriptionExtensions
8+
{
9+
/// <summary>
10+
/// Generates an URI-friendly ID for the <see cref="ApiDescription"/>. E.g. "Get-Values-id_name" instead of "GetValues/{id}?name={name}"
11+
/// </summary>
12+
/// <param name="description">The <see cref="ApiDescription"/>.</param>
13+
/// <returns>The ID as a string.</returns>
14+
public static string GetFriendlyId(this ApiDescription description)
15+
{
16+
var path = description.RelativePath;
17+
var urlParts = path.Split('?');
18+
var localPath = urlParts[0];
19+
string queryKeyString = null;
20+
if (urlParts.Length > 1)
21+
{
22+
var query = urlParts[1];
23+
var queryKeys = HttpUtility.ParseQueryString(query).AllKeys;
24+
queryKeyString = string.Join("_", queryKeys);
25+
}
26+
27+
var friendlyPath = new StringBuilder();
28+
friendlyPath.AppendFormat("{0}-{1}",
29+
description.HttpMethod.Method,
30+
localPath.Replace("/", "-").Replace("{", string.Empty).Replace("}", string.Empty));
31+
if (queryKeyString != null)
32+
{
33+
friendlyPath.AppendFormat("_{0}", queryKeyString.Replace('.', '-'));
34+
}
35+
return friendlyPath.ToString();
36+
}
37+
}
38+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using System.Web.Http;
2+
using System.Web.Mvc;
3+
4+
namespace Aspose.Cells.API.Areas.HelpPage.Controllers
5+
{
6+
/// <summary>
7+
/// The controller that will handle requests for the help page.
8+
/// </summary>
9+
public class HelpController : Controller
10+
{
11+
private const string ErrorViewName = "Error";
12+
13+
public HelpController() : this(GlobalConfiguration.Configuration)
14+
{
15+
}
16+
17+
public HelpController(HttpConfiguration config)
18+
{
19+
Configuration = config;
20+
}
21+
22+
public HttpConfiguration Configuration { get; private set; }
23+
24+
public ActionResult Index()
25+
{
26+
ViewBag.DocumentationProvider = Configuration.Services.GetDocumentationProvider();
27+
return View(Configuration.Services.GetApiExplorer().ApiDescriptions);
28+
}
29+
30+
public ActionResult Api(string apiId)
31+
{
32+
if (string.IsNullOrEmpty(apiId)) return View(ErrorViewName);
33+
var apiModel = Configuration.GetHelpPageApiModel(apiId);
34+
return apiModel != null ? View(apiModel) : View(ErrorViewName);
35+
}
36+
37+
public ActionResult ResourceModel(string modelName)
38+
{
39+
if (string.IsNullOrEmpty(modelName)) return View(ErrorViewName);
40+
var modelDescriptionGenerator = Configuration.GetModelDescriptionGenerator();
41+
return modelDescriptionGenerator.GeneratedModels.TryGetValue(modelName, out var modelDescription) ? View(modelDescription) : View(ErrorViewName);
42+
}
43+
}
44+
}
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
.help-page h1,
2+
.help-page .h1,
3+
.help-page h2,
4+
.help-page .h2,
5+
.help-page h3,
6+
.help-page .h3,
7+
#body.help-page,
8+
.help-page-table th,
9+
.help-page-table pre,
10+
.help-page-table p {
11+
font-family: "Segoe UI Light", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
12+
}
13+
14+
.help-page pre.wrapped {
15+
white-space: -moz-pre-wrap;
16+
white-space: -pre-wrap;
17+
white-space: -o-pre-wrap;
18+
white-space: pre-wrap;
19+
}
20+
21+
.help-page .warning-message-container {
22+
margin-top: 20px;
23+
padding: 0 10px;
24+
color: #525252;
25+
background: #EFDCA9;
26+
border: 1px solid #CCCCCC;
27+
}
28+
29+
.help-page-table {
30+
width: 100%;
31+
border-collapse: collapse;
32+
text-align: left;
33+
margin: 0 0 20px 0;
34+
border-top: 1px solid #D4D4D4;
35+
}
36+
37+
.help-page-table th {
38+
text-align: left;
39+
font-weight: bold;
40+
border-bottom: 1px solid #D4D4D4;
41+
padding: 5px 6px 5px 6px;
42+
}
43+
44+
.help-page-table td {
45+
border-bottom: 1px solid #D4D4D4;
46+
padding: 10px 8px 10px 8px;
47+
vertical-align: top;
48+
}
49+
50+
.help-page-table pre,
51+
.help-page-table p {
52+
margin: 0;
53+
padding: 0;
54+
font-family: inherit;
55+
font-size: 100%;
56+
}
57+
58+
.help-page-table tbody tr:hover td {
59+
background-color: #F3F3F3;
60+
}
61+
62+
.help-page a:hover {
63+
background-color: transparent;
64+
}
65+
66+
.help-page .sample-header {
67+
border: 2px solid #D4D4D4;
68+
background: #00497E;
69+
color: #FFFFFF;
70+
padding: 8px 15px;
71+
border-bottom: none;
72+
display: inline-block;
73+
margin: 10px 0 0 0;
74+
}
75+
76+
.help-page .sample-content {
77+
display: block;
78+
padding: 15px 20px;
79+
background: #FFFFFF;
80+
border: 2px solid #D4D4D4;
81+
margin: 0 0 10px 0;
82+
}
83+
84+
.help-page .api-name {
85+
width: 40%;
86+
}
87+
88+
.help-page .api-documentation {
89+
width: 60%;
90+
}
91+
92+
.help-page .parameter-name {
93+
width: 20%;
94+
}
95+
96+
.help-page .parameter-documentation {
97+
width: 40%;
98+
}
99+
100+
.help-page .parameter-type {
101+
width: 20%;
102+
}
103+
104+
.help-page .parameter-annotations {
105+
width: 20%;
106+
}
107+
108+
.help-page h1,
109+
.help-page .h1 {
110+
font-size: 36px;
111+
line-height: normal;
112+
}
113+
114+
.help-page h2,
115+
.help-page .h2 {
116+
font-size: 24px;
117+
}
118+
119+
.help-page h3,
120+
.help-page .h3 {
121+
font-size: 20px;
122+
}
123+
124+
#body.help-page {
125+
font-size: 14px;
126+
line-height: 143%;
127+
color: #333;
128+
}
129+
130+
.help-page a {
131+
color: #0000EE;
132+
text-decoration: none;
133+
}

0 commit comments

Comments
 (0)