Skip to content
This repository was archived by the owner on Jan 15, 2023. It is now read-only.

Commit 03bc7e8

Browse files
committed
Upgraded to use nugets version 5.2.96-pre01.
1 parent c1e08dd commit 03bc7e8

File tree

847 files changed

+223467
-41416
lines changed

Some content is hidden

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

847 files changed

+223467
-41416
lines changed

angular-react-vue/.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[*.{cs,vb}]
2+
3+
# IDE0046: Convert to conditional expression
4+
dotnet_diagnostic.IDE0046.severity = silent
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<None Include="..\.editorconfig" Link=".editorconfig" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<PackageReference Include="Chromely" Version="5.2.96-pre01" />
15+
</ItemGroup>
16+
17+
18+
</Project>
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Copyright © 2017 Chromely Projects. All rights reserved.
2+
// Use of this source code is governed by MIT license that can be found in the LICENSE file.
3+
4+
#pragma warning disable CA1822
5+
#pragma warning disable IDE0079
6+
7+
namespace Chromely.Shared.ChromelyControllers;
8+
9+
/// <summary>
10+
/// The demo controller.
11+
/// </summary>
12+
[ChromelyController(Name = "ExecuteJavaScriptDemoController")]
13+
public class ExecuteJavaScriptDemoController : ChromelyController
14+
{
15+
private readonly IChromelyConfiguration _config;
16+
17+
/// <summary>
18+
/// Initializes a new instance of the <see cref="ExecuteJavaScriptDemoController"/> class.
19+
/// </summary>
20+
public ExecuteJavaScriptDemoController(IChromelyConfiguration config)
21+
{
22+
_config = config;
23+
}
24+
25+
[ChromelyRoute(Path = "/executejavascript/execute")]
26+
public IChromelyResponse Execute(string framename, string script)
27+
{
28+
var response = new ChromelyResponse()
29+
{
30+
ReadyState = (int)ReadyState.ResponseIsReady,
31+
Status = (int)System.Net.HttpStatusCode.OK,
32+
StatusText = "OK",
33+
Data = DateTime.Now.ToLongDateString()
34+
};
35+
36+
try
37+
{
38+
var scriptExecutor = _config?.JavaScriptExecutor;
39+
if (scriptExecutor == null)
40+
{
41+
response.Data = $"Frame {framename} does not exist.";
42+
return response;
43+
}
44+
45+
scriptExecutor.ExecuteScript(script);
46+
response.Data = "Executed script :" + script;
47+
return response;
48+
}
49+
catch (Exception e)
50+
{
51+
Logger.Instance.Log.LogError(e);
52+
response.Data = e.Message;
53+
response.ReadyState = (int)ReadyState.RequestReceived;
54+
response.Status = (int)System.Net.HttpStatusCode.BadRequest;
55+
response.StatusText = "Error";
56+
}
57+
58+
return response;
59+
}
60+
}
61+
62+
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
// Copyright © 2017 Chromely Projects. All rights reserved.
2+
// Use of this source code is governed by MIT license that can be found in the LICENSE file.
3+
4+
#pragma warning disable CA1822
5+
6+
namespace Chromely.Shared.ChromelyControllers;
7+
8+
/// <summary>
9+
/// The movie controller.
10+
/// </summary>
11+
[ChromelyController(Name = "MovieController")]
12+
public class MovieController : ChromelyController
13+
{
14+
private readonly IChromelyConfiguration _config;
15+
16+
/// <summary>
17+
/// Initializes a new instance of the <see cref="MovieController"/> class.
18+
/// </summary>
19+
public MovieController(IChromelyConfiguration config)
20+
{
21+
_config = config;
22+
}
23+
24+
25+
[ChromelyRoute(Path = "/democontroller/showdevtools")]
26+
public void ShowDevTools()
27+
{
28+
if (_config != null && !string.IsNullOrWhiteSpace(_config.DevToolsUrl))
29+
{
30+
BrowserLauncher.Open(_config.Platform, _config.DevToolsUrl);
31+
}
32+
}
33+
34+
[ChromelyRoute(Path = "/democontroller/movies/get")]
35+
public List<MovieInfo> GetMovies()
36+
{
37+
var movieInfos = new List<MovieInfo>();
38+
var assemblyName = typeof(MovieInfo).Assembly.GetName().Name ?? string.Empty;
39+
40+
movieInfos.Add(new MovieInfo(id: 1, title: "The Shawshank Redemption", year: 1994, votes: 678790, rating: 9.2, assembly: assemblyName));
41+
movieInfos.Add(new MovieInfo(id: 2, title: "The Godfather", year: 1972, votes: 511495, rating: 9.2, assembly: assemblyName));
42+
movieInfos.Add(new MovieInfo(id: 3, title: "The Godfather: Part II", year: 1974, votes: 319352, rating: 9.0, assembly: assemblyName));
43+
movieInfos.Add(new MovieInfo(id: 4, title: "The Good, the Bad and the Ugly", year: 1966, votes: 213030, rating: 8.9, assembly: assemblyName));
44+
movieInfos.Add(new MovieInfo(id: 5, title: "My Fair Lady", year: 1964, votes: 533848, rating: 8.9, assembly: assemblyName));
45+
movieInfos.Add(new MovieInfo(id: 6, title: "12 Angry Men", year: 1957, votes: 164558, rating: 8.9, assembly: assemblyName));
46+
47+
return movieInfos;
48+
}
49+
50+
[ChromelyRoute(Path = "/democontroller/movies/post")]
51+
public string SaveMovies(List<MovieInfo> movies)
52+
{
53+
var rowsReceived = movies != null ? movies.Count : 0;
54+
return $"{DateTime.Now}: {rowsReceived} rows of data successfully saved.";
55+
}
56+
}
57+
58+
/// <summary>
59+
/// The movie info.
60+
/// </summary>
61+
public class MovieInfo
62+
{
63+
/// <summary>
64+
/// Initializes a new instance of the <see cref="MovieInfo"/> class.
65+
/// </summary>
66+
public MovieInfo()
67+
{
68+
}
69+
70+
/// <summary>
71+
/// Initializes a new instance of the <see cref="MovieInfo"/> class.
72+
/// </summary>
73+
/// <param name="id">
74+
/// The id.
75+
/// </param>
76+
/// <param name="title">
77+
/// The title.
78+
/// </param>
79+
/// <param name="year">
80+
/// The year.
81+
/// </param>
82+
/// <param name="votes">
83+
/// The votes.
84+
/// </param>
85+
/// <param name="rating">
86+
/// The rating.
87+
/// </param>
88+
/// <param name="assembly">
89+
/// The assembly.
90+
/// </param>
91+
public MovieInfo(int id, string title, int year, int votes, double rating, string assembly)
92+
{
93+
Id = id;
94+
Title = title;
95+
Year = year;
96+
Votes = votes;
97+
Rating = rating;
98+
Date = DateTime.Now;
99+
RestfulAssembly = assembly;
100+
}
101+
102+
public int Id { get; set; }
103+
104+
public string? Title { get; set; }
105+
106+
public int Year { get; set; }
107+
108+
public int Votes { get; set; }
109+
110+
public double Rating { get; set; }
111+
112+
public DateTime Date { get; set; }
113+
114+
public string? RestfulAssembly { get; set; }
115+
}
116+

0 commit comments

Comments
 (0)