增加Rider项目模板

This commit is contained in:
小红帽 2023-12-06 13:58:36 +08:00
parent b1202e35f9
commit fb9b04e7a0
6 changed files with 646 additions and 0 deletions

View File

@ -0,0 +1,38 @@
{
"author": "CPF",
"name": "CPFApplication1",
"description": "CPF项目NetCore跨平台开发 that can run on .NET on Windows, Linux and macOS",
"identity": "YourName.CPFApplication",
"shortName": "CPFApplication1",
"tags": {
"language": "C#",
"type": "project"
},
"sourceName": "CPFApplication1",
"symbols": {
"Framework": {
"type": "parameter",
"description": "The target framework for the project.",
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp3.1"
},
{
"choice": "net5"
},
{
"choice": "net6"
},
{
"choice": "net7"
},
{
"choice": "net8"
}
],
"defaultValue": "net6"
}
}
}

View File

@ -0,0 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ApplicationIcon />
<StartupObject />
<LangVersion>9.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants />
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<None Remove="Stylesheet1.css" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Stylesheet1.css" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xhm.CPF" Version="0.9.6.*" />
<PackageReference Include="Xhm.CPF.Windows" Version="0.9.6.*" />
<PackageReference Include="Xhm.CPF.Skia" Version="0.9.6.*" />
<PackageReference Include="Xhm.CPF.Mac" Version="0.9.6.*" />
<PackageReference Include="Xhm.CPF.Linux" Version="0.9.6.*" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,21 @@
using CPF.Platform;
using CPF.Skia;
using CPF.Windows;
using System;
namespace CPFApplication1
{
internal class Program
{
[STAThread]
static void Main(string[] args)
{
Application.Initialize(
(OperatingSystemType.Windows, new WindowsPlatform(), new SkiaDrawingFactory())
, (OperatingSystemType.OSX, new CPF.Mac.MacPlatform(), new SkiaDrawingFactory())//如果需要支持Mac才需要
, (OperatingSystemType.Linux, new CPF.Linux.LinuxPlatform(), new SkiaDrawingFactory())//如果需要支持Linux才需要
);
Application.Run(new Window1());
}
}
}

View File

@ -0,0 +1,502 @@
/*@font-face {
font-family: '微软雅黑';
src: url('res://ConsoleApp1/msyh.ttc');
}*/ /*加载字体*/
/** {
FontFamily: 微软雅黑;
}*/
@media windows {
* {
FontFamily: '微软雅黑'; /*不同系统的字体不同,自己根据情况改或者使用内嵌字体*/
}
}
@media osx {
* {
FontFamily: '苹方-简';
}
}
@media linux {
* {
FontFamily: '文泉驿正黑';
}
}
/*设置窗体标题栏背景颜色圆角*/
/*#caption {
IsAntiAlias: true;
Background: #2c2c2c;
CornerRadius:5,5,0,0;
Height:30;
}
#frame {
CornerRadius: 5;
IsAntiAlias: true;
}*/
Button {
BorderFill: #DCDFE6;
IsAntiAlias: True;
CornerRadius: 4,4,4,4;
Background: #FFFFFF;
}
Button[IsMouseOver=true] {
BorderFill: rgb(198,226,255);
Background: rgb(236,245,255);
Foreground: rgb(64,158,255);
}
Button[IsPressed=true] {
BorderFill: rgb(58,142,230);
}
Button.primary {
BorderFill: rgb(64,158,255);
CornerRadius: 4,4,4,4;
Background: rgb(64,158,255);
Foreground: #FFFFFF;
}
Button.primary[IsMouseOver=true] {
BorderFill: rgb(102,177,255);
Background: rgb(102,177,255);
Foreground: #FFFFFF;
}
Button.primary[IsPressed=true] {
BorderFill: rgb(58,142,230);
Background: rgb(58,142,230);
}
Button.success {
BorderFill: rgb(103,194,58);
CornerRadius: 4,4,4,4;
Background: rgb(103,194,58);
Foreground: #FFFFFF;
}
Button.success[IsMouseOver=true] {
BorderFill: rgb(133,206,97);
Background: rgb(133,206,97);
Foreground: #FFFFFF;
}
Button.success[IsPressed=true] {
BorderFill: rgb(93,175,52);
Background: rgb(93,175,52);
}
Button.danger {
BorderFill: rgb(245,108,108);
Background: rgb(245,108,108);
CornerRadius: 4,4,4,4;
Foreground: #FFFFFF;
}
Button.danger[IsMouseOver=true] {
BorderFill: rgb(247,137,137);
Background: rgb(247,137,137);
Foreground: #FFFFFF;
}
Button.danger[IsPressed=true] {
BorderFill: rgb(221,97,97);
Background: rgb(221,97,97);
}
#dialogClose {
BorderFill: null;
}
TextBox, .textBox, DatePicker {
Background: #fff;
IsAntiAlias: true;
BorderFill: #DCDFE6;
CornerRadius: 4,4,4,4;
BorderStroke: 1;
}
.groupPanel TextBox, DatePicker TextBox, .textBox TextBox {
BorderStroke: 0;
}
.textBox[IsKeyboardFocusWithin=true] {
BorderFill: #1E9FFF;
}
.singleLine { /*单行文本框*/
AcceptsReturn: false;
HScrollBarVisibility: Hidden;
VScrollBarVisibility: Hidden;
}
.singleLine #contentPresenter {
Padding: 3;
}
.multiline { /*多行文本框*/
}
.slotLeft {
CornerRadius: 0,4,4,0;
BorderFill: #DCDFE6;
Background: #F5F7FA;
BorderThickness: 1,0,0,0;
BorderType: BorderThickness;
MarginTop: 0;
MarginBottom: 0;
MarginRight: 0;
}
RadioButton #radioButtonBorder {
StrokeFill: rgb(220,223,230);
}
RadioButton[IsChecked=true] #radioButtonBorder {
StrokeFill: #1E9FFF;
Fill: #1E9FFF;
}
RadioButton #optionMark {
StrokeFill: #1E9FFF;
Fill: #fff;
}
CheckBox #indeterminateMark {
Fill: #1E9FFF;
}
CheckBox #checkBoxBorder {
Background: #fff;
BorderFill: rgb(220,223,230);
}
CheckBox[IsChecked=true] #checkBoxBorder {
Background: #1E9FFF;
BorderFill: #1E9FFF;
}
CheckBox Polyline {
StrokeFill: #fff;
}
.radioGroup {
BorderType: BorderThickness;
BorderFill: rgb(220,223,230);
BorderThickness: 1,1,0,1;
}
.radioGroup RadioButton {
BorderType: BorderThickness;
BorderFill: rgb(220,223,230);
BorderThickness: 0,0,1,0;
}
.radioGroup RadioButton #markPanel {
Visibility: Collapsed;
}
.radioGroup RadioButton TextBlock {
Margin: 5;
}
.radioGroup RadioButton[IsChecked=true] {
Background: rgb(64,158,255);
Foreground: #fff;
}
.error {
Foreground: #f00;
Visibility: Collapsed;
}
.error[DesignMode=true] {
Visibility: Visible;
}
.twoLine[AttachedExtenstions.IsError=true] .error {
Visibility: Visible;
}
.twoLine[AttachedExtenstions.IsError=true] .textBox {
BorderFill: #f00;
}
ScrollBar {
Background: null;
}
ScrollBar Thumb {
IsAntiAlias: true;
CornerRadius: 5;
}
ScrollBar[Orientation=Horizontal] {
Height: 12;
}
ScrollBar[Orientation=Vertical] {
Width: 12;
}
ScrollBar #PART_LineUpButton, ScrollBar #PART_LineDownButton {
Visibility: Collapsed;
}
ComboBox {
Background: #fff;
IsAntiAlias: true;
BorderFill: #DCDFE6;
CornerRadius: 4,4,4,4;
BorderStroke: 1;
}
ComboBox[IsKeyboardFocusWithin=true] {
BorderFill: #1E9FFF;
}
#DropDownPanel TextBlock {
MarginLeft: 5;
MarginTop: 2;
MarginBottom: 2;
}
#dropDownBorder {
ShadowBlur: 2;
ShadowColor: rgba(0, 0, 0, 0.4);
BorderStroke: 0;
}
#DropDownPanel[IsMouseOver=false] ScrollBar {
Visibility: Collapsed;
}
#DropDownPanel ScrollBar[Orientation=Horizontal] {
Height: 10;
}
#DropDownPanel ScrollBar[Orientation=Vertical] {
Width: 10;
}
Slider {
IsAntiAlias: true;
}
Slider Thumb {
IsAntiAlias: true;
Width: 16;
Height: 16;
CornerRadius: 7;
BorderFill: rgb(64,158,255);
BorderStroke: 2;
Background: #fff;
ZIndex: 1;
}
Slider Thumb[IsMouseOver=true] {
animation-name: sliderMouseOver;
animation-duration: 0.1s;
animation-iteration-count: 1;
animation-fill-mode: forwards;
}
Slider #TrackBackground {
CornerRadius: 2;
Background: rgb(228,231,237);
BorderStroke: 0;
}
Slider #decreaseRepeatButton {
Background: rgb(64,158,255);
CornerRadius: 2;
}
Slider[Orientation=Horizontal] #decreaseRepeatButton {
Height: 4;
MarginLeft: 5;
}
Slider[Orientation=Vertical] #decreaseRepeatButton {
Width: 4;
MarginBottom: 5;
}
ProgressBar {
CornerRadius: 5;
IsAntiAlias: true;
BorderFill: null;
Background: rgb(235,238,245);
}
ProgressBar #Indicator, ProgressBar #Animation {
CornerRadius: 5;
}
NumericUpDown {
Background: #fff;
IsAntiAlias: true;
BorderFill: #DCDFE6;
CornerRadius: 4,4,4,4;
BorderStroke: 1;
}
NumericUpDown RepeatButton {
Width: 20;
Background: rgb(245,247,250);
}
NumericUpDown #decreaseBtn {
CornerRadius: 4,0,0,4;
}
NumericUpDown #increaseBtn {
CornerRadius: 0,4,4,0;
}
NumericUpDown #textBoxBorder {
BorderFill: #DCDFE6;
}
NumericUpDown TextBox {
BorderStroke: 0;
}
.widget {
IsAntiAlias: true;
BorderFill: #DCDFE6;
CornerRadius: 4,4,4,4;
BorderStroke: 1;
}
.widgetHead {
Background: linear-gradient(0 0,0 100%,#F7F7F7 0,#F0F0F0 1);
BorderType: BorderThickness;
BorderThickness: 0,0,0,1;
BorderFill: #DCDFE6;
}
DataGrid {
Foreground: #7a7a7a;
}
DataGridCellTemplate, DataGridRow, DataGrid, .DataGridCell {
BorderFill: rgb(235,238,245);
}
DataGridRow {
Height: 36;
}
DataGridRow[IsMouseOver=true] {
Background: rgb(245,247,250);
}
DataGridRow[IsSelected=true] {
Background: rgb(245,247,250);
}
DataGridColumnTemplate {
Height: 38;
FontSize: 15;
FontStyle: Bold;
Background: #fff;
BorderFill: rgb(235,238,245);
}
TabControl #headBorder {
Background: #fff;
}
TabItem > Border {
BorderThickness: 0,0,0,2;
}
TabItem[IsSelected=true] > Border {
BorderFill: #1E9FFF;
}
TabItem[IsSelected=true] {
Foreground: #1E9FFF;
}
TabControl[TabStripPlacement=Left] TabItem, TabControl[TabStripPlacement=Right] TabItem {
Width: 100%;
BorderType: BorderThickness;
BorderThickness: 0,0,0,1;
BorderFill: #e8e8e8;
}
TabControl[TabStripPlacement=Left] TabItem TextBlock {
MarginRight: 0;
}
TabControl[TabStripPlacement=Left] TabItem > Border {
Width: 100%;
}
TabControl[TabStripPlacement=Left] #headerPanel, TabControl[TabStripPlacement=Right] #headerPanel {
Width: 100;
Background: rgb(245,247,250);
}
.closeBtn[IsMouseOver=true] {
Fill: #171717;
}
.placeholder {
IsHitTestVisible: false;
Foreground: "192,196,204";
Visibility: Collapsed;
}
.textBox[AttachedExtenstions.IsEmpty=true] .placeholder {
Visibility: Visible;
}
.loginBox TextBox, .loginBox .placeholder {
FontSize: 16;
}
.loginBox CheckBox {
Foreground: #757575;
}
.searchBox Button {
CornerRadius: 0,4,4,0,
}
#MenuPop #menuPanel > Border, #MenuPop ContextMenu > Border {
Background: #fff;
ShadowColor: rgba(0, 0, 0, 0.4);
}
#MenuPop MenuItem[IsMouseOver=true] {
Background: #DCDFE6;
}
ListBoxItem {
Width: 100%;
}
#dialogClose, #dialogClose[IsMouseOver=true] {
Background: null;
BorderFill: null;
}
#dialogClose[IsPressed=true] {
Background: null;
BorderFill: null;
}
#dialogClose Line {
StrokeFill: 218,218,218;
}
#dialogClose[IsMouseOver=true] Line {
StrokeFill: #fff;
}

View File

@ -0,0 +1,52 @@
using CPF;
using CPF.Animation;
using CPF.Charts;
using CPF.Controls;
using CPF.Drawing;
using CPF.Shapes;
using CPF.Styling;
using CPF.Svg;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CPFApplication1
{
public class Window1 : Window
{
protected override void InitializeComponent()
{
LoadStyleFile("res://CPFApplication1/Stylesheet1.css");//加载样式文件,文件需要设置为内嵌资源
Title = "标题";
Width = 500;
Height = 400;
Background = null;
Children.Add(new WindowFrame(this, new Panel
{
Width = "100%",
Height = "100%",
Children =
{
new Button{ Content="按钮" }
}
}));
if (!DesignMode)//设计模式下不执行,也可以用#if !DesignMode
{
}
}
#if !DesignMode //用户代码写到这里,设计器下不执行,防止设计器出错
protected override void OnInitialized()
{
base.OnInitialized();
}
//用户代码
#endif
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB