Skip to content

Commit eff2e7c

Browse files
committed
Add Vue Desktop Template
1 parent 38cac45 commit eff2e7c

Some content is hidden

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

67 files changed

+3688
-1
lines changed

.gitignore

Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.suo
6+
*.user
7+
*.userosscache
8+
*.sln.docstates
9+
src/**/*.js
10+
*bundle.min.css
11+
*bundle.min.js
12+
dist/
13+
GPUCache
14+
15+
# User-specific files (MonoDevelop/Xamarin Studio)
16+
*.userprefs
17+
18+
# Build results
19+
[Dd]ebug/
20+
[Dd]ebugPublic/
21+
[Rr]elease/
22+
[Rr]eleases/
23+
x64/
24+
x86/
25+
bld/
26+
[Bb]in/
27+
[Oo]bj/
28+
[Ll]og/
29+
30+
# Visual Studio 2015 cache/options directory
31+
.vs/
32+
# Uncomment if you have tasks that create the project's static files in wwwroot
33+
#wwwroot/
34+
35+
# MSTest test Results
36+
[Tt]est[Rr]esult*/
37+
[Bb]uild[Ll]og.*
38+
39+
# NUNIT
40+
*.VisualState.xml
41+
TestResult.xml
42+
43+
# Build Results of an ATL Project
44+
[Dd]ebugPS/
45+
[Rr]eleasePS/
46+
dlldata.c
47+
48+
# DNX
49+
project.lock.json
50+
artifacts/
51+
52+
*_i.c
53+
*_p.c
54+
*_i.h
55+
*.ilk
56+
*.meta
57+
*.obj
58+
*.pch
59+
*.pdb
60+
*.pgc
61+
*.pgd
62+
*.rsp
63+
*.sbr
64+
*.tlb
65+
*.tli
66+
*.tlh
67+
*.tmp
68+
*.tmp_proj
69+
*.log
70+
*.vspscc
71+
*.vssscc
72+
.builds
73+
*.pidb
74+
*.svclog
75+
*.scc
76+
77+
# Chutzpah Test files
78+
_Chutzpah*
79+
80+
# Visual C++ cache files
81+
ipch/
82+
*.aps
83+
*.ncb
84+
*.opendb
85+
*.opensdf
86+
*.sdf
87+
*.cachefile
88+
*.VC.db
89+
*.VC.VC.opendb
90+
91+
# Visual Studio profiler
92+
*.psess
93+
*.vsp
94+
*.vspx
95+
*.sap
96+
97+
# TFS 2012 Local Workspace
98+
$tf/
99+
100+
# Guidance Automation Toolkit
101+
*.gpState
102+
103+
# ReSharper is a .NET coding add-in
104+
_ReSharper*/
105+
*.[Rr]e[Ss]harper
106+
*.DotSettings.user
107+
108+
# JustCode is a .NET coding add-in
109+
.JustCode
110+
111+
# TeamCity is a build add-in
112+
_TeamCity*
113+
114+
# DotCover is a Code Coverage Tool
115+
*.dotCover
116+
117+
# NCrunch
118+
_NCrunch_*
119+
.*crunch*.local.xml
120+
nCrunchTemp_*
121+
122+
# MightyMoose
123+
*.mm.*
124+
AutoTest.Net/
125+
126+
# Web workbench (sass)
127+
.sass-cache/
128+
129+
# Installshield output folder
130+
[Ee]xpress/
131+
132+
# DocProject is a documentation generator add-in
133+
DocProject/buildhelp/
134+
DocProject/Help/*.HxT
135+
DocProject/Help/*.HxC
136+
DocProject/Help/*.hhc
137+
DocProject/Help/*.hhk
138+
DocProject/Help/*.hhp
139+
DocProject/Help/Html2
140+
DocProject/Help/html
141+
142+
# Click-Once directory
143+
publish/
144+
145+
# Publish Web Output
146+
*.[Pp]ublish.xml
147+
*.azurePubxml
148+
# TODO: Comment the next line if you want to checkin your web deploy settings
149+
# but database connection strings (with potential passwords) will be unencrypted
150+
*.pubxml
151+
*.publishproj
152+
153+
# Microsoft Azure Web App publish settings. Comment the next line if you want to
154+
# checkin your Azure Web App publish settings, but sensitive information contained
155+
# in these scripts will be unencrypted
156+
PublishScripts/
157+
158+
# NuGet Packages
159+
*.nupkg
160+
# The packages folder can be ignored because of Package Restore
161+
**/packages/*
162+
# except build/, which is used as an MSBuild target.
163+
!**/packages/build/
164+
# Uncomment if necessary however generally it will be regenerated when needed
165+
#!**/packages/repositories.config
166+
# NuGet v3's project.json files produces more ignoreable files
167+
*.nuget.props
168+
*.nuget.targets
169+
170+
# Microsoft Azure Build Output
171+
csx/
172+
*.build.csdef
173+
174+
# Microsoft Azure Emulator
175+
ecf/
176+
rcf/
177+
178+
# Windows Store app package directories and files
179+
AppPackages/
180+
BundleArtifacts/
181+
Package.StoreAssociation.xml
182+
_pkginfo.txt
183+
184+
# Visual Studio cache files
185+
# files ending in .cache can be ignored
186+
*.[Cc]ache
187+
# but keep track of directories ending in .cache
188+
!*.[Cc]ache/
189+
190+
# Others
191+
ClientBin/
192+
~$*
193+
*~
194+
*.dbmdl
195+
*.dbproj.schemaview
196+
*.pfx
197+
*.publishsettings
198+
node_modules/
199+
orleans.codegen.cs
200+
201+
# Since there are multiple workflows, uncomment next line to ignore bower_components
202+
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
203+
#bower_components/
204+
205+
# RIA/Silverlight projects
206+
Generated_Code/
207+
208+
# Backup & report files from converting an old project file
209+
# to a newer Visual Studio version. Backup files are not needed,
210+
# because we have git ;-)
211+
_UpgradeReport_Files/
212+
Backup*/
213+
UpgradeLog*.XML
214+
UpgradeLog*.htm
215+
216+
# SQL Server files
217+
*.mdf
218+
*.ldf
219+
220+
# Business Intelligence projects
221+
*.rdl.data
222+
*.bim.layout
223+
*.bim_*.settings
224+
225+
# Microsoft Fakes
226+
FakesAssemblies/
227+
228+
# GhostDoc plugin setting file
229+
*.GhostDoc.xml
230+
231+
# Node.js Tools for Visual Studio
232+
.ntvs_analysis.dat
233+
234+
# Visual Studio 6 build log
235+
*.plg
236+
237+
# Visual Studio 6 workspace options file
238+
*.opt
239+
240+
# Visual Studio LightSwitch build output
241+
**/*.HTMLClient/GeneratedArtifacts
242+
**/*.DesktopClient/GeneratedArtifacts
243+
**/*.DesktopClient/ModelManifest.xml
244+
**/*.Server/GeneratedArtifacts
245+
**/*.Server/ModelManifest.xml
246+
_Pvt_Extensions
247+
248+
# Paket dependency manager
249+
.paket/paket.exe
250+
paket-files/
251+
252+
# FAKE - F# Make
253+
.fake/
254+
255+
# JetBrains Rider
256+
.idea/
257+
*.sln.iml

CustomMethods.cs

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
using System;
2+
using System.Drawing;
3+
using System.Runtime.InteropServices;
4+
using ServiceStack.Desktop;
5+
using ServiceStack.Script;
6+
7+
namespace MyApp
8+
{
9+
public class CustomMethods : ScriptMethods
10+
{
11+
[DllImport("ComDlg32.dll", CharSet = CharSet.Unicode)]
12+
internal static extern int CommDlgExtendedError();
13+
14+
[DllImport("ComDlg32.dll", CharSet = CharSet.Unicode)]
15+
internal static extern bool ChooseColor(ref ChooseColor cc);
16+
17+
private int[] customColors = new int[16] {
18+
0x00FFFFFF, 0x00C0C0C0, 0x00808080, 0x00000000,
19+
0x00FF0000, 0x00800000, 0x00FFFF00, 0x00808000,
20+
0x0000FF00, 0x00008000, 0x0000FFFF, 0x00008080,
21+
0x000000FF, 0x00000080, 0x00FF00FF, 0x00800080,
22+
};
23+
24+
public string chooseColor(ScriptScopeContext scope) => chooseColor(scope, "#ffffff");
25+
26+
public string chooseColor(ScriptScopeContext scope, string defaultColor) => scope.DoWindow(w => {
27+
var cc = new ChooseColor();
28+
cc.lStructSize = Marshal.SizeOf(cc);
29+
var lpCustColors = Marshal.AllocCoTaskMem(16 * sizeof(int));
30+
try
31+
{
32+
Marshal.Copy(customColors, 0, lpCustColors,16);
33+
cc.hwndOwner = w;
34+
cc.lpCustColors = lpCustColors;
35+
cc.Flags = ChooseColorFlags.FullOpen | ChooseColorFlags.RgbInit;
36+
var c = ColorTranslator.FromHtml(defaultColor);
37+
cc.rgbResult = ColorTranslator.ToWin32(c);
38+
39+
if (!ChooseColor(ref cc))
40+
return (string) null;
41+
42+
c = ColorTranslator.FromWin32(cc.rgbResult);
43+
return ColorTranslator.ToHtml(c);
44+
}
45+
finally
46+
{
47+
Marshal.FreeCoTaskMem(lpCustColors);
48+
}
49+
});
50+
}
51+
52+
static class ChooseColorFlags
53+
{
54+
public const int RgbInit = 0x00000001;
55+
public const int FullOpen = 0x00000002;
56+
public const int PreventFullOpen = 0x00000004;
57+
public const int ShowHelp = 0x00000008;
58+
public const int EnableHook = 0x00000010;
59+
public const int EnableTemplate = 0x00000020;
60+
public const int EnableTemplateHandle = 0x00000040;
61+
public const int SolidColor = 0x00000080;
62+
public const int AnyColor = 0x00000100;
63+
}
64+
struct ChooseColor
65+
{
66+
public int lStructSize;
67+
public IntPtr hwndOwner;
68+
public IntPtr hInstance;
69+
public int rgbResult;
70+
public IntPtr lpCustColors;
71+
public int Flags;
72+
public IntPtr lCustData;
73+
public CCHookProc lpfnHook;
74+
public IntPtr lpTemplateName;
75+
}
76+
delegate IntPtr CCHookProc(IntPtr hWnd, ushort msg, int wParam, int lParam);
77+
}

MyApp.csproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="ServiceStack" Version="5.*" />
9+
<PackageReference Include="ServiceStack.Server" Version="5.*" />
10+
<PackageReference Include="ServiceStack.OrmLite.Sqlite" Version="5.*" />
11+
<PackageReference Include="ServiceStack.Desktop" Version="5.*" />
12+
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
13+
</ItemGroup>
14+
15+
<Target Name="Bundle" BeforeTargets="AfterPublish">
16+
<Exec Command="x run _bundle.ss -to /bin/Release/netcoreapp3.1/publish/wwwroot" />
17+
</Target>
18+
</Project>

NuGet.Config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="ServiceStack MyGet feed" value="https://www.myget.org/F/servicestack" />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
6+
</packageSources>
7+
</configuration>

Program.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Hosting;
6+
using Microsoft.Extensions.Configuration;
7+
using Microsoft.Extensions.Hosting;
8+
using Microsoft.Extensions.Logging;
9+
10+
namespace MyApp
11+
{
12+
public class Program
13+
{
14+
public static void Main(string[] args)
15+
{
16+
CreateHostBuilder(args).Build().Run();
17+
}
18+
19+
public static IHostBuilder CreateHostBuilder(string[] args) =>
20+
Host.CreateDefaultBuilder(args)
21+
.ConfigureWebHostDefaults(webBuilder => {
22+
webBuilder.UseStartup<Startup>();
23+
});
24+
}
25+
}

0 commit comments

Comments
 (0)