From 368a0f4ffbb8d4c932405fec6f53460770d19de7 Mon Sep 17 00:00:00 2001 From: YangCheng <235160615@qq.com> Date: Fri, 1 Dec 2023 12:48:21 +0800 Subject: [PATCH 1/2] 111 --- .../AdditionalAttributes/Border/BorderAddShadow.cs | 0 .../AdditionalAttributes/Button/ButtonHave_Popup.cs | 0 .../TextBlock/TextBlockAddUnderLine.cs | 0 .../TextBox/CustomTextBoxAttachProperty.cs | 0 .../AdditionalAttributes/TextBox/TextBoxAttach.cs | 0 .../Application/VampirewalApplication.cs | 0 .../AssemblyInfo.cs | 0 .../Behaviors/DataGridBehavior.cs | 0 .../Behaviors/NumTextBoxBehavior.cs | 0 .../Common/TouchEventCommands.cs | 0 .../Converter/Bool2VisibilityConverter.cs | 0 .../Converter/BoolReverseConverter.cs | 0 .../Converter/DataContextConverter.cs | 0 .../Converter/Enum2StringConverter.cs | 0 .../Converter/String2ColorConverter.cs | 0 .../CustomControl/CalendarControl/Calendar.xaml | 0 .../CustomControl/CalendarControl/Calendar.xaml.cs | 0 .../CustomControl/DataGrid/DataGridStyles.xaml | 0 .../CustomControl/EditPage/EditContainer.cs | 0 .../CustomControl/EditPage/EditContaninerStyle.xaml | 0 .../CustomControl/EditPage/EditItem.cs | 0 .../CustomControl/FlowDesignControl/FlowDesign.cs | 0 .../FlowDesignControl/FlowDesignStyle.xaml | 0 .../CustomControl/FlowDesignControl/FlowNode.cs | 0 .../FlowDesignControl/FlowNodePosition.cs | 0 .../CustomControl/GridLengthAnimation.cs | 0 .../LoadingContainer/LoadingContainer.cs | 0 .../LoadingContainer/LoadingContainerStyle.xaml | 0 .../CustomControl/MaskDialogGrid/MaskDialogGrid.cs | 0 .../MaskDialogGrid/MaskDialogGridStyle.xaml | 0 .../CustomControl/NumTextBox/NumTextBox.cs | 0 .../CustomControl/NumTextBox/NumTextBoxStyle.xaml | 0 .../CustomControl/Pagination/VPagination.cs | 0 .../CustomControl/Pagination/VPaginationStyles.xaml | 0 .../CustomControl/RadarChartControl/RadarChart.cs | 0 .../RadarChartControl/RadarControl.xaml | 0 .../RadarChartControl/RadarControl.xaml.cs | 0 .../CustomControl/SearchControl/SearchControl.cs | 0 .../SearchControl/SearchControlStyle.xaml | 0 .../CustomControl/TextBox/TextBoxStyles.xaml | 0 .../CustomControl/TitleContent/TitleContent.cs | 0 .../CustomControl/TitleContent/TitleContents.xaml | 0 .../CustomControl/TreeListView/FirstColumn.cs | 0 .../CustomControl/TreeListView/TreeListView.cs | 0 .../TreeListView/TreeListViewStyle.xaml | 0 .../CustomControl/TreeListView/list_header_bk.png | Bin .../CustomControl/TreeView/TreeViewStyles.xaml | 0 .../CustomUC/AddOrEditUcViewBase.cs | 0 .../FrameworkControl/CustomUC/LayoutUcViewBase.cs | 0 .../CustomUC/TopLeftRightUcViewBase.cs | 0 .../FrameworkControl/CustomUC/UcViewBase.cs | 0 .../FrameworkControl/CustomUC/UcViewStyles.xaml | 0 .../FrameworkControl/CustomWinodw/MainWindowBase.cs | 0 .../CustomWinodw/NotifyDefultView.xaml | 0 .../CustomWinodw/NotifyDefultView.xaml.cs | 0 .../FrameworkControl/CustomWinodw/NotifyWindow.xaml | 0 .../CustomWinodw/NotifyWindow.xaml.cs | 0 .../FrameworkControl/CustomWinodw/PopupWindow.xaml | 0 .../CustomWinodw/PopupWindow.xaml.cs | 0 .../CustomWinodw/ShowDialogWindow.xaml | 0 .../CustomWinodw/ShowDialogWindow.xaml.cs | 0 .../CustomWinodw/VampirewalFolderBrowserDialog.xaml | 0 .../VampirewalFolderBrowserDialog.xaml.cs | 0 .../FrameworkControl/CustomWinodw/WindowBase.cs | 0 .../FrameworkControl/CustomWinodw/WindowStyles.xaml | 0 .../GlobalUsing.cs | 0 .../Theme.xaml | 0 .../Utils/AnimationHelper.cs | 0 .../Vampirewal-Logo.png | Bin .../Vampirewal.Core.WPF.Theme.csproj | 0 Vampirewal.Core.sln | 2 +- 71 files changed, 1 insertion(+), 1 deletion(-) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/AdditionalAttributes/Border/BorderAddShadow.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/AdditionalAttributes/Button/ButtonHave_Popup.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/AdditionalAttributes/TextBlock/TextBlockAddUnderLine.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/AdditionalAttributes/TextBox/CustomTextBoxAttachProperty.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/AdditionalAttributes/TextBox/TextBoxAttach.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/Application/VampirewalApplication.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/AssemblyInfo.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/Behaviors/DataGridBehavior.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/Behaviors/NumTextBoxBehavior.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/Common/TouchEventCommands.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/Converter/Bool2VisibilityConverter.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/Converter/BoolReverseConverter.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/Converter/DataContextConverter.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/Converter/Enum2StringConverter.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/Converter/String2ColorConverter.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/CalendarControl/Calendar.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/CalendarControl/Calendar.xaml.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/DataGrid/DataGridStyles.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/EditPage/EditContainer.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/EditPage/EditContaninerStyle.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/EditPage/EditItem.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/FlowDesignControl/FlowDesign.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/FlowDesignControl/FlowDesignStyle.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/FlowDesignControl/FlowNode.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/FlowDesignControl/FlowNodePosition.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/GridLengthAnimation.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/LoadingContainer/LoadingContainer.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/LoadingContainer/LoadingContainerStyle.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/MaskDialogGrid/MaskDialogGrid.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/MaskDialogGrid/MaskDialogGridStyle.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/NumTextBox/NumTextBox.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/NumTextBox/NumTextBoxStyle.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/Pagination/VPagination.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/Pagination/VPaginationStyles.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/RadarChartControl/RadarChart.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/RadarChartControl/RadarControl.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/RadarChartControl/RadarControl.xaml.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/SearchControl/SearchControl.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/SearchControl/SearchControlStyle.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/TextBox/TextBoxStyles.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/TitleContent/TitleContent.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/TitleContent/TitleContents.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/TreeListView/FirstColumn.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/TreeListView/TreeListView.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/TreeListView/TreeListViewStyle.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/TreeListView/list_header_bk.png (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/CustomControl/TreeView/TreeViewStyles.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomUC/AddOrEditUcViewBase.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomUC/LayoutUcViewBase.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomUC/TopLeftRightUcViewBase.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomUC/UcViewBase.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomUC/UcViewStyles.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomWinodw/MainWindowBase.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomWinodw/NotifyDefultView.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomWinodw/NotifyDefultView.xaml.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomWinodw/NotifyWindow.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomWinodw/NotifyWindow.xaml.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomWinodw/PopupWindow.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomWinodw/PopupWindow.xaml.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomWinodw/ShowDialogWindow.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomWinodw/ShowDialogWindow.xaml.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomWinodw/VampirewalFolderBrowserDialog.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomWinodw/VampirewalFolderBrowserDialog.xaml.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomWinodw/WindowBase.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/FrameworkControl/CustomWinodw/WindowStyles.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/GlobalUsing.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/Theme.xaml (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/Utils/AnimationHelper.cs (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/Vampirewal-Logo.png (100%) rename {YC.WPF.Theme => Vampirewal.Core.WPF.Theme}/Vampirewal.Core.WPF.Theme.csproj (100%) diff --git a/YC.WPF.Theme/AdditionalAttributes/Border/BorderAddShadow.cs b/Vampirewal.Core.WPF.Theme/AdditionalAttributes/Border/BorderAddShadow.cs similarity index 100% rename from YC.WPF.Theme/AdditionalAttributes/Border/BorderAddShadow.cs rename to Vampirewal.Core.WPF.Theme/AdditionalAttributes/Border/BorderAddShadow.cs diff --git a/YC.WPF.Theme/AdditionalAttributes/Button/ButtonHave_Popup.cs b/Vampirewal.Core.WPF.Theme/AdditionalAttributes/Button/ButtonHave_Popup.cs similarity index 100% rename from YC.WPF.Theme/AdditionalAttributes/Button/ButtonHave_Popup.cs rename to Vampirewal.Core.WPF.Theme/AdditionalAttributes/Button/ButtonHave_Popup.cs diff --git a/YC.WPF.Theme/AdditionalAttributes/TextBlock/TextBlockAddUnderLine.cs b/Vampirewal.Core.WPF.Theme/AdditionalAttributes/TextBlock/TextBlockAddUnderLine.cs similarity index 100% rename from YC.WPF.Theme/AdditionalAttributes/TextBlock/TextBlockAddUnderLine.cs rename to Vampirewal.Core.WPF.Theme/AdditionalAttributes/TextBlock/TextBlockAddUnderLine.cs diff --git a/YC.WPF.Theme/AdditionalAttributes/TextBox/CustomTextBoxAttachProperty.cs b/Vampirewal.Core.WPF.Theme/AdditionalAttributes/TextBox/CustomTextBoxAttachProperty.cs similarity index 100% rename from YC.WPF.Theme/AdditionalAttributes/TextBox/CustomTextBoxAttachProperty.cs rename to Vampirewal.Core.WPF.Theme/AdditionalAttributes/TextBox/CustomTextBoxAttachProperty.cs diff --git a/YC.WPF.Theme/AdditionalAttributes/TextBox/TextBoxAttach.cs b/Vampirewal.Core.WPF.Theme/AdditionalAttributes/TextBox/TextBoxAttach.cs similarity index 100% rename from YC.WPF.Theme/AdditionalAttributes/TextBox/TextBoxAttach.cs rename to Vampirewal.Core.WPF.Theme/AdditionalAttributes/TextBox/TextBoxAttach.cs diff --git a/YC.WPF.Theme/Application/VampirewalApplication.cs b/Vampirewal.Core.WPF.Theme/Application/VampirewalApplication.cs similarity index 100% rename from YC.WPF.Theme/Application/VampirewalApplication.cs rename to Vampirewal.Core.WPF.Theme/Application/VampirewalApplication.cs diff --git a/YC.WPF.Theme/AssemblyInfo.cs b/Vampirewal.Core.WPF.Theme/AssemblyInfo.cs similarity index 100% rename from YC.WPF.Theme/AssemblyInfo.cs rename to Vampirewal.Core.WPF.Theme/AssemblyInfo.cs diff --git a/YC.WPF.Theme/Behaviors/DataGridBehavior.cs b/Vampirewal.Core.WPF.Theme/Behaviors/DataGridBehavior.cs similarity index 100% rename from YC.WPF.Theme/Behaviors/DataGridBehavior.cs rename to Vampirewal.Core.WPF.Theme/Behaviors/DataGridBehavior.cs diff --git a/YC.WPF.Theme/Behaviors/NumTextBoxBehavior.cs b/Vampirewal.Core.WPF.Theme/Behaviors/NumTextBoxBehavior.cs similarity index 100% rename from YC.WPF.Theme/Behaviors/NumTextBoxBehavior.cs rename to Vampirewal.Core.WPF.Theme/Behaviors/NumTextBoxBehavior.cs diff --git a/YC.WPF.Theme/Common/TouchEventCommands.cs b/Vampirewal.Core.WPF.Theme/Common/TouchEventCommands.cs similarity index 100% rename from YC.WPF.Theme/Common/TouchEventCommands.cs rename to Vampirewal.Core.WPF.Theme/Common/TouchEventCommands.cs diff --git a/YC.WPF.Theme/Converter/Bool2VisibilityConverter.cs b/Vampirewal.Core.WPF.Theme/Converter/Bool2VisibilityConverter.cs similarity index 100% rename from YC.WPF.Theme/Converter/Bool2VisibilityConverter.cs rename to Vampirewal.Core.WPF.Theme/Converter/Bool2VisibilityConverter.cs diff --git a/YC.WPF.Theme/Converter/BoolReverseConverter.cs b/Vampirewal.Core.WPF.Theme/Converter/BoolReverseConverter.cs similarity index 100% rename from YC.WPF.Theme/Converter/BoolReverseConverter.cs rename to Vampirewal.Core.WPF.Theme/Converter/BoolReverseConverter.cs diff --git a/YC.WPF.Theme/Converter/DataContextConverter.cs b/Vampirewal.Core.WPF.Theme/Converter/DataContextConverter.cs similarity index 100% rename from YC.WPF.Theme/Converter/DataContextConverter.cs rename to Vampirewal.Core.WPF.Theme/Converter/DataContextConverter.cs diff --git a/YC.WPF.Theme/Converter/Enum2StringConverter.cs b/Vampirewal.Core.WPF.Theme/Converter/Enum2StringConverter.cs similarity index 100% rename from YC.WPF.Theme/Converter/Enum2StringConverter.cs rename to Vampirewal.Core.WPF.Theme/Converter/Enum2StringConverter.cs diff --git a/YC.WPF.Theme/Converter/String2ColorConverter.cs b/Vampirewal.Core.WPF.Theme/Converter/String2ColorConverter.cs similarity index 100% rename from YC.WPF.Theme/Converter/String2ColorConverter.cs rename to Vampirewal.Core.WPF.Theme/Converter/String2ColorConverter.cs diff --git a/YC.WPF.Theme/CustomControl/CalendarControl/Calendar.xaml b/Vampirewal.Core.WPF.Theme/CustomControl/CalendarControl/Calendar.xaml similarity index 100% rename from YC.WPF.Theme/CustomControl/CalendarControl/Calendar.xaml rename to Vampirewal.Core.WPF.Theme/CustomControl/CalendarControl/Calendar.xaml diff --git a/YC.WPF.Theme/CustomControl/CalendarControl/Calendar.xaml.cs b/Vampirewal.Core.WPF.Theme/CustomControl/CalendarControl/Calendar.xaml.cs similarity index 100% rename from YC.WPF.Theme/CustomControl/CalendarControl/Calendar.xaml.cs rename to Vampirewal.Core.WPF.Theme/CustomControl/CalendarControl/Calendar.xaml.cs diff --git a/YC.WPF.Theme/CustomControl/DataGrid/DataGridStyles.xaml b/Vampirewal.Core.WPF.Theme/CustomControl/DataGrid/DataGridStyles.xaml similarity index 100% rename from YC.WPF.Theme/CustomControl/DataGrid/DataGridStyles.xaml rename to Vampirewal.Core.WPF.Theme/CustomControl/DataGrid/DataGridStyles.xaml diff --git a/YC.WPF.Theme/CustomControl/EditPage/EditContainer.cs b/Vampirewal.Core.WPF.Theme/CustomControl/EditPage/EditContainer.cs similarity index 100% rename from YC.WPF.Theme/CustomControl/EditPage/EditContainer.cs rename to Vampirewal.Core.WPF.Theme/CustomControl/EditPage/EditContainer.cs diff --git a/YC.WPF.Theme/CustomControl/EditPage/EditContaninerStyle.xaml b/Vampirewal.Core.WPF.Theme/CustomControl/EditPage/EditContaninerStyle.xaml similarity index 100% rename from YC.WPF.Theme/CustomControl/EditPage/EditContaninerStyle.xaml rename to Vampirewal.Core.WPF.Theme/CustomControl/EditPage/EditContaninerStyle.xaml diff --git a/YC.WPF.Theme/CustomControl/EditPage/EditItem.cs b/Vampirewal.Core.WPF.Theme/CustomControl/EditPage/EditItem.cs similarity index 100% rename from YC.WPF.Theme/CustomControl/EditPage/EditItem.cs rename to Vampirewal.Core.WPF.Theme/CustomControl/EditPage/EditItem.cs diff --git a/YC.WPF.Theme/CustomControl/FlowDesignControl/FlowDesign.cs b/Vampirewal.Core.WPF.Theme/CustomControl/FlowDesignControl/FlowDesign.cs similarity index 100% rename from YC.WPF.Theme/CustomControl/FlowDesignControl/FlowDesign.cs rename to Vampirewal.Core.WPF.Theme/CustomControl/FlowDesignControl/FlowDesign.cs diff --git a/YC.WPF.Theme/CustomControl/FlowDesignControl/FlowDesignStyle.xaml b/Vampirewal.Core.WPF.Theme/CustomControl/FlowDesignControl/FlowDesignStyle.xaml similarity index 100% rename from YC.WPF.Theme/CustomControl/FlowDesignControl/FlowDesignStyle.xaml rename to Vampirewal.Core.WPF.Theme/CustomControl/FlowDesignControl/FlowDesignStyle.xaml diff --git a/YC.WPF.Theme/CustomControl/FlowDesignControl/FlowNode.cs b/Vampirewal.Core.WPF.Theme/CustomControl/FlowDesignControl/FlowNode.cs similarity index 100% rename from YC.WPF.Theme/CustomControl/FlowDesignControl/FlowNode.cs rename to Vampirewal.Core.WPF.Theme/CustomControl/FlowDesignControl/FlowNode.cs diff --git a/YC.WPF.Theme/CustomControl/FlowDesignControl/FlowNodePosition.cs b/Vampirewal.Core.WPF.Theme/CustomControl/FlowDesignControl/FlowNodePosition.cs similarity index 100% rename from YC.WPF.Theme/CustomControl/FlowDesignControl/FlowNodePosition.cs rename to Vampirewal.Core.WPF.Theme/CustomControl/FlowDesignControl/FlowNodePosition.cs diff --git a/YC.WPF.Theme/CustomControl/GridLengthAnimation.cs b/Vampirewal.Core.WPF.Theme/CustomControl/GridLengthAnimation.cs similarity index 100% rename from YC.WPF.Theme/CustomControl/GridLengthAnimation.cs rename to Vampirewal.Core.WPF.Theme/CustomControl/GridLengthAnimation.cs diff --git a/YC.WPF.Theme/CustomControl/LoadingContainer/LoadingContainer.cs b/Vampirewal.Core.WPF.Theme/CustomControl/LoadingContainer/LoadingContainer.cs similarity index 100% rename from YC.WPF.Theme/CustomControl/LoadingContainer/LoadingContainer.cs rename to Vampirewal.Core.WPF.Theme/CustomControl/LoadingContainer/LoadingContainer.cs diff --git a/YC.WPF.Theme/CustomControl/LoadingContainer/LoadingContainerStyle.xaml b/Vampirewal.Core.WPF.Theme/CustomControl/LoadingContainer/LoadingContainerStyle.xaml similarity index 100% rename from YC.WPF.Theme/CustomControl/LoadingContainer/LoadingContainerStyle.xaml rename to Vampirewal.Core.WPF.Theme/CustomControl/LoadingContainer/LoadingContainerStyle.xaml diff --git a/YC.WPF.Theme/CustomControl/MaskDialogGrid/MaskDialogGrid.cs b/Vampirewal.Core.WPF.Theme/CustomControl/MaskDialogGrid/MaskDialogGrid.cs similarity index 100% rename from YC.WPF.Theme/CustomControl/MaskDialogGrid/MaskDialogGrid.cs rename to Vampirewal.Core.WPF.Theme/CustomControl/MaskDialogGrid/MaskDialogGrid.cs diff --git a/YC.WPF.Theme/CustomControl/MaskDialogGrid/MaskDialogGridStyle.xaml b/Vampirewal.Core.WPF.Theme/CustomControl/MaskDialogGrid/MaskDialogGridStyle.xaml similarity index 100% rename from YC.WPF.Theme/CustomControl/MaskDialogGrid/MaskDialogGridStyle.xaml rename to Vampirewal.Core.WPF.Theme/CustomControl/MaskDialogGrid/MaskDialogGridStyle.xaml diff --git a/YC.WPF.Theme/CustomControl/NumTextBox/NumTextBox.cs b/Vampirewal.Core.WPF.Theme/CustomControl/NumTextBox/NumTextBox.cs similarity index 100% rename from YC.WPF.Theme/CustomControl/NumTextBox/NumTextBox.cs rename to Vampirewal.Core.WPF.Theme/CustomControl/NumTextBox/NumTextBox.cs diff --git a/YC.WPF.Theme/CustomControl/NumTextBox/NumTextBoxStyle.xaml b/Vampirewal.Core.WPF.Theme/CustomControl/NumTextBox/NumTextBoxStyle.xaml similarity index 100% rename from YC.WPF.Theme/CustomControl/NumTextBox/NumTextBoxStyle.xaml rename to Vampirewal.Core.WPF.Theme/CustomControl/NumTextBox/NumTextBoxStyle.xaml diff --git a/YC.WPF.Theme/CustomControl/Pagination/VPagination.cs b/Vampirewal.Core.WPF.Theme/CustomControl/Pagination/VPagination.cs similarity index 100% rename from YC.WPF.Theme/CustomControl/Pagination/VPagination.cs rename to Vampirewal.Core.WPF.Theme/CustomControl/Pagination/VPagination.cs diff --git a/YC.WPF.Theme/CustomControl/Pagination/VPaginationStyles.xaml b/Vampirewal.Core.WPF.Theme/CustomControl/Pagination/VPaginationStyles.xaml similarity index 100% rename from YC.WPF.Theme/CustomControl/Pagination/VPaginationStyles.xaml rename to Vampirewal.Core.WPF.Theme/CustomControl/Pagination/VPaginationStyles.xaml diff --git a/YC.WPF.Theme/CustomControl/RadarChartControl/RadarChart.cs b/Vampirewal.Core.WPF.Theme/CustomControl/RadarChartControl/RadarChart.cs similarity index 100% rename from YC.WPF.Theme/CustomControl/RadarChartControl/RadarChart.cs rename to Vampirewal.Core.WPF.Theme/CustomControl/RadarChartControl/RadarChart.cs diff --git a/YC.WPF.Theme/CustomControl/RadarChartControl/RadarControl.xaml b/Vampirewal.Core.WPF.Theme/CustomControl/RadarChartControl/RadarControl.xaml similarity index 100% rename from YC.WPF.Theme/CustomControl/RadarChartControl/RadarControl.xaml rename to Vampirewal.Core.WPF.Theme/CustomControl/RadarChartControl/RadarControl.xaml diff --git a/YC.WPF.Theme/CustomControl/RadarChartControl/RadarControl.xaml.cs b/Vampirewal.Core.WPF.Theme/CustomControl/RadarChartControl/RadarControl.xaml.cs similarity index 100% rename from YC.WPF.Theme/CustomControl/RadarChartControl/RadarControl.xaml.cs rename to Vampirewal.Core.WPF.Theme/CustomControl/RadarChartControl/RadarControl.xaml.cs diff --git a/YC.WPF.Theme/CustomControl/SearchControl/SearchControl.cs b/Vampirewal.Core.WPF.Theme/CustomControl/SearchControl/SearchControl.cs similarity index 100% rename from YC.WPF.Theme/CustomControl/SearchControl/SearchControl.cs rename to Vampirewal.Core.WPF.Theme/CustomControl/SearchControl/SearchControl.cs diff --git a/YC.WPF.Theme/CustomControl/SearchControl/SearchControlStyle.xaml b/Vampirewal.Core.WPF.Theme/CustomControl/SearchControl/SearchControlStyle.xaml similarity index 100% rename from YC.WPF.Theme/CustomControl/SearchControl/SearchControlStyle.xaml rename to Vampirewal.Core.WPF.Theme/CustomControl/SearchControl/SearchControlStyle.xaml diff --git a/YC.WPF.Theme/CustomControl/TextBox/TextBoxStyles.xaml b/Vampirewal.Core.WPF.Theme/CustomControl/TextBox/TextBoxStyles.xaml similarity index 100% rename from YC.WPF.Theme/CustomControl/TextBox/TextBoxStyles.xaml rename to Vampirewal.Core.WPF.Theme/CustomControl/TextBox/TextBoxStyles.xaml diff --git a/YC.WPF.Theme/CustomControl/TitleContent/TitleContent.cs b/Vampirewal.Core.WPF.Theme/CustomControl/TitleContent/TitleContent.cs similarity index 100% rename from YC.WPF.Theme/CustomControl/TitleContent/TitleContent.cs rename to Vampirewal.Core.WPF.Theme/CustomControl/TitleContent/TitleContent.cs diff --git a/YC.WPF.Theme/CustomControl/TitleContent/TitleContents.xaml b/Vampirewal.Core.WPF.Theme/CustomControl/TitleContent/TitleContents.xaml similarity index 100% rename from YC.WPF.Theme/CustomControl/TitleContent/TitleContents.xaml rename to Vampirewal.Core.WPF.Theme/CustomControl/TitleContent/TitleContents.xaml diff --git a/YC.WPF.Theme/CustomControl/TreeListView/FirstColumn.cs b/Vampirewal.Core.WPF.Theme/CustomControl/TreeListView/FirstColumn.cs similarity index 100% rename from YC.WPF.Theme/CustomControl/TreeListView/FirstColumn.cs rename to Vampirewal.Core.WPF.Theme/CustomControl/TreeListView/FirstColumn.cs diff --git a/YC.WPF.Theme/CustomControl/TreeListView/TreeListView.cs b/Vampirewal.Core.WPF.Theme/CustomControl/TreeListView/TreeListView.cs similarity index 100% rename from YC.WPF.Theme/CustomControl/TreeListView/TreeListView.cs rename to Vampirewal.Core.WPF.Theme/CustomControl/TreeListView/TreeListView.cs diff --git a/YC.WPF.Theme/CustomControl/TreeListView/TreeListViewStyle.xaml b/Vampirewal.Core.WPF.Theme/CustomControl/TreeListView/TreeListViewStyle.xaml similarity index 100% rename from YC.WPF.Theme/CustomControl/TreeListView/TreeListViewStyle.xaml rename to Vampirewal.Core.WPF.Theme/CustomControl/TreeListView/TreeListViewStyle.xaml diff --git a/YC.WPF.Theme/CustomControl/TreeListView/list_header_bk.png b/Vampirewal.Core.WPF.Theme/CustomControl/TreeListView/list_header_bk.png similarity index 100% rename from YC.WPF.Theme/CustomControl/TreeListView/list_header_bk.png rename to Vampirewal.Core.WPF.Theme/CustomControl/TreeListView/list_header_bk.png diff --git a/YC.WPF.Theme/CustomControl/TreeView/TreeViewStyles.xaml b/Vampirewal.Core.WPF.Theme/CustomControl/TreeView/TreeViewStyles.xaml similarity index 100% rename from YC.WPF.Theme/CustomControl/TreeView/TreeViewStyles.xaml rename to Vampirewal.Core.WPF.Theme/CustomControl/TreeView/TreeViewStyles.xaml diff --git a/YC.WPF.Theme/FrameworkControl/CustomUC/AddOrEditUcViewBase.cs b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomUC/AddOrEditUcViewBase.cs similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomUC/AddOrEditUcViewBase.cs rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomUC/AddOrEditUcViewBase.cs diff --git a/YC.WPF.Theme/FrameworkControl/CustomUC/LayoutUcViewBase.cs b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomUC/LayoutUcViewBase.cs similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomUC/LayoutUcViewBase.cs rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomUC/LayoutUcViewBase.cs diff --git a/YC.WPF.Theme/FrameworkControl/CustomUC/TopLeftRightUcViewBase.cs b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomUC/TopLeftRightUcViewBase.cs similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomUC/TopLeftRightUcViewBase.cs rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomUC/TopLeftRightUcViewBase.cs diff --git a/YC.WPF.Theme/FrameworkControl/CustomUC/UcViewBase.cs b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomUC/UcViewBase.cs similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomUC/UcViewBase.cs rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomUC/UcViewBase.cs diff --git a/YC.WPF.Theme/FrameworkControl/CustomUC/UcViewStyles.xaml b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomUC/UcViewStyles.xaml similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomUC/UcViewStyles.xaml rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomUC/UcViewStyles.xaml diff --git a/YC.WPF.Theme/FrameworkControl/CustomWinodw/MainWindowBase.cs b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/MainWindowBase.cs similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomWinodw/MainWindowBase.cs rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/MainWindowBase.cs diff --git a/YC.WPF.Theme/FrameworkControl/CustomWinodw/NotifyDefultView.xaml b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/NotifyDefultView.xaml similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomWinodw/NotifyDefultView.xaml rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/NotifyDefultView.xaml diff --git a/YC.WPF.Theme/FrameworkControl/CustomWinodw/NotifyDefultView.xaml.cs b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/NotifyDefultView.xaml.cs similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomWinodw/NotifyDefultView.xaml.cs rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/NotifyDefultView.xaml.cs diff --git a/YC.WPF.Theme/FrameworkControl/CustomWinodw/NotifyWindow.xaml b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/NotifyWindow.xaml similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomWinodw/NotifyWindow.xaml rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/NotifyWindow.xaml diff --git a/YC.WPF.Theme/FrameworkControl/CustomWinodw/NotifyWindow.xaml.cs b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/NotifyWindow.xaml.cs similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomWinodw/NotifyWindow.xaml.cs rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/NotifyWindow.xaml.cs diff --git a/YC.WPF.Theme/FrameworkControl/CustomWinodw/PopupWindow.xaml b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/PopupWindow.xaml similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomWinodw/PopupWindow.xaml rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/PopupWindow.xaml diff --git a/YC.WPF.Theme/FrameworkControl/CustomWinodw/PopupWindow.xaml.cs b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/PopupWindow.xaml.cs similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomWinodw/PopupWindow.xaml.cs rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/PopupWindow.xaml.cs diff --git a/YC.WPF.Theme/FrameworkControl/CustomWinodw/ShowDialogWindow.xaml b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/ShowDialogWindow.xaml similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomWinodw/ShowDialogWindow.xaml rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/ShowDialogWindow.xaml diff --git a/YC.WPF.Theme/FrameworkControl/CustomWinodw/ShowDialogWindow.xaml.cs b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/ShowDialogWindow.xaml.cs similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomWinodw/ShowDialogWindow.xaml.cs rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/ShowDialogWindow.xaml.cs diff --git a/YC.WPF.Theme/FrameworkControl/CustomWinodw/VampirewalFolderBrowserDialog.xaml b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/VampirewalFolderBrowserDialog.xaml similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomWinodw/VampirewalFolderBrowserDialog.xaml rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/VampirewalFolderBrowserDialog.xaml diff --git a/YC.WPF.Theme/FrameworkControl/CustomWinodw/VampirewalFolderBrowserDialog.xaml.cs b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/VampirewalFolderBrowserDialog.xaml.cs similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomWinodw/VampirewalFolderBrowserDialog.xaml.cs rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/VampirewalFolderBrowserDialog.xaml.cs diff --git a/YC.WPF.Theme/FrameworkControl/CustomWinodw/WindowBase.cs b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/WindowBase.cs similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomWinodw/WindowBase.cs rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/WindowBase.cs diff --git a/YC.WPF.Theme/FrameworkControl/CustomWinodw/WindowStyles.xaml b/Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/WindowStyles.xaml similarity index 100% rename from YC.WPF.Theme/FrameworkControl/CustomWinodw/WindowStyles.xaml rename to Vampirewal.Core.WPF.Theme/FrameworkControl/CustomWinodw/WindowStyles.xaml diff --git a/YC.WPF.Theme/GlobalUsing.cs b/Vampirewal.Core.WPF.Theme/GlobalUsing.cs similarity index 100% rename from YC.WPF.Theme/GlobalUsing.cs rename to Vampirewal.Core.WPF.Theme/GlobalUsing.cs diff --git a/YC.WPF.Theme/Theme.xaml b/Vampirewal.Core.WPF.Theme/Theme.xaml similarity index 100% rename from YC.WPF.Theme/Theme.xaml rename to Vampirewal.Core.WPF.Theme/Theme.xaml diff --git a/YC.WPF.Theme/Utils/AnimationHelper.cs b/Vampirewal.Core.WPF.Theme/Utils/AnimationHelper.cs similarity index 100% rename from YC.WPF.Theme/Utils/AnimationHelper.cs rename to Vampirewal.Core.WPF.Theme/Utils/AnimationHelper.cs diff --git a/YC.WPF.Theme/Vampirewal-Logo.png b/Vampirewal.Core.WPF.Theme/Vampirewal-Logo.png similarity index 100% rename from YC.WPF.Theme/Vampirewal-Logo.png rename to Vampirewal.Core.WPF.Theme/Vampirewal-Logo.png diff --git a/YC.WPF.Theme/Vampirewal.Core.WPF.Theme.csproj b/Vampirewal.Core.WPF.Theme/Vampirewal.Core.WPF.Theme.csproj similarity index 100% rename from YC.WPF.Theme/Vampirewal.Core.WPF.Theme.csproj rename to Vampirewal.Core.WPF.Theme/Vampirewal.Core.WPF.Theme.csproj diff --git a/Vampirewal.Core.sln b/Vampirewal.Core.sln index e545319..abcb849 100644 --- a/Vampirewal.Core.sln +++ b/Vampirewal.Core.sln @@ -5,7 +5,7 @@ VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vampirewal.Core", "Vampirewal.Core\Vampirewal.Core.csproj", "{F8ECA7C6-2E83-44BE-9B6E-D09E189FD3CC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vampirewal.Core.WPF.Theme", "YC.WPF.Theme\Vampirewal.Core.WPF.Theme.csproj", "{8B832967-AD6A-4094-A299-FE5F9991AE83}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vampirewal.Core.WPF.Theme", "Vampirewal.Core.WPF.Theme\Vampirewal.Core.WPF.Theme.csproj", "{8B832967-AD6A-4094-A299-FE5F9991AE83}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "test.View", "test\test.View.csproj", "{B622E036-C59A-4E28-8F68-AFC5392D0410}" EndProject -- Gitee From d2fa8be867cd6602c9e21699a02516a6ec751567 Mon Sep 17 00:00:00 2001 From: YangCheng <235160615@qq.com> Date: Tue, 19 Dec 2023 16:35:20 +0800 Subject: [PATCH 2/2] 123 --- Test.Console/Program.cs | 2 - Test.Console/Test.Console.csproj | 1 - Vampirewal.Core.MiniApi/DynamicPorxy.cs | 90 +++++++ Vampirewal.Core.MiniApi/ExpressionTool.cs | 84 +++++++ .../HttpRouterAttribute.cs | 88 +++++++ .../IVampirewalRegisterMiniApi.cs | 42 ++++ .../Vampirewal.Core.MiniApi.csproj | 21 ++ .../VampirewalMiniApiBootStartup.cs | 220 ++++++++++++++++++ Vampirewal.Core.sln | 9 +- test.ViewModel/MainViewModel.cs | 30 ++- test.ViewModel/MiniApiController.cs | 169 ++++++++++++++ test.ViewModel/TestBootStartUp.cs | 135 ++++++++--- test.ViewModel/test.ViewModel.csproj | 1 + test/MainWindow.xaml.cs | 12 + test/test.View.csproj | 2 +- 15 files changed, 861 insertions(+), 45 deletions(-) create mode 100644 Vampirewal.Core.MiniApi/DynamicPorxy.cs create mode 100644 Vampirewal.Core.MiniApi/ExpressionTool.cs create mode 100644 Vampirewal.Core.MiniApi/HttpRouterAttribute.cs create mode 100644 Vampirewal.Core.MiniApi/IVampirewalRegisterMiniApi.cs create mode 100644 Vampirewal.Core.MiniApi/Vampirewal.Core.MiniApi.csproj create mode 100644 Vampirewal.Core.MiniApi/VampirewalMiniApiBootStartup.cs create mode 100644 test.ViewModel/MiniApiController.cs diff --git a/Test.Console/Program.cs b/Test.Console/Program.cs index bc3aaac..21c0906 100644 --- a/Test.Console/Program.cs +++ b/Test.Console/Program.cs @@ -1,6 +1,5 @@  -using Microsoft.Extensions.DependencyInjection; using System; using System.Collections; using System.Collections.Generic; @@ -12,7 +11,6 @@ using System.Runtime.Serialization; using Vampirewal.Core.EventBus; using Vampirewal.Core.Mapper; using Vampirewal.Coree.ClassObjectPool; -using Yitter.IdGenerator; namespace Test.Console; diff --git a/Test.Console/Test.Console.csproj b/Test.Console/Test.Console.csproj index 23cd747..66dcf8f 100644 --- a/Test.Console/Test.Console.csproj +++ b/Test.Console/Test.Console.csproj @@ -13,7 +13,6 @@ - diff --git a/Vampirewal.Core.MiniApi/DynamicPorxy.cs b/Vampirewal.Core.MiniApi/DynamicPorxy.cs new file mode 100644 index 0000000..caf0cd0 --- /dev/null +++ b/Vampirewal.Core.MiniApi/DynamicPorxy.cs @@ -0,0 +1,90 @@ +#region << 文件说明 >> +/*---------------------------------------------------------------- + * 命名空间:Vampirewal.Core.MiniApi + * 唯一标识:c1a29bc3-9771-470a-8fc3-7f6679520ded + * 文件名:DynamicPorxy + * + * 创建者:杨程 + * 电子邮箱:235160615@qq.com + * 创建时间:2023/12/18 19:43:30 + * 版本:V1.0.0 + * 描述: + * + * ---------------------------------------------------------------- + * 修改人: + * 时间: + * 修改说明: + * + * 版本:V1.0.1 + *----------------------------------------------------------------*/ +#endregion << 文件说明 >> + +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + + +namespace Vampirewal.Core.MiniApi; + +internal abstract class DynamicPorxy +{ + public abstract Delegate Instance { get; set; } +} + + +/// +/// 0个参数 +/// +/// +/// +internal class DynamicPorxyImpl : DynamicPorxy where Timpl : class where Toutput : class +{ + public override Delegate Instance { get; set; } + public DynamicPorxyImpl(MethodInfo method) + { + Instance = ([FromServices] IServiceProvider sp) => ExpressionTool.CreateMethodDelegate(method)(sp.GetService(typeof(Timpl)) as Timpl); + + } +} + +/// +/// 1个参数 +/// +/// +/// +/// +internal class DynamicPorxyImpl : DynamicPorxy where Timpl : class where Tinput : class where Toutput : class +{ + public override Delegate Instance { get; set; } + public DynamicPorxyImpl(MethodInfo method) + { + Instance = ([FromServices] IServiceProvider sp, Tinput input) => ExpressionTool.CreateMethodDelegate(method)(sp.GetService(typeof(Timpl)) as Timpl, input); + } +} + +/// +/// 2个参数 +/// +/// +/// +/// +/// +internal class DynamicPorxyImpl : DynamicPorxy + where Timpl : class + where Tinput1 : class + where Tinput2 : class + where Toutput : class +{ + public override Delegate Instance { get; set; } + public DynamicPorxyImpl(MethodInfo method) + { + Instance = ([FromServices] IServiceProvider sp, Tinput1 input1, Tinput2 input2) => ExpressionTool.CreateMethodDelegate(method)(sp.GetService(typeof(Timpl)) as Timpl, input1, input2); + } +} + + diff --git a/Vampirewal.Core.MiniApi/ExpressionTool.cs b/Vampirewal.Core.MiniApi/ExpressionTool.cs new file mode 100644 index 0000000..d6d28f4 --- /dev/null +++ b/Vampirewal.Core.MiniApi/ExpressionTool.cs @@ -0,0 +1,84 @@ +#region << 文件说明 >> +/*---------------------------------------------------------------- + * 命名空间:Vampirewal.Core.MiniApi + * 唯一标识:7be9e4ce-ae45-41d1-96d1-8d5563ae9277 + * 文件名:ExpressionTool + * + * 创建者:杨程 + * 电子邮箱:235160615@qq.com + * 创建时间:2023/12/18 19:44:17 + * 版本:V1.0.0 + * 描述: + * + * ---------------------------------------------------------------- + * 修改人: + * 时间: + * 修改说明: + * + * 版本:V1.0.1 + *----------------------------------------------------------------*/ +#endregion << 文件说明 >> + +using NetTaste; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + + +namespace Vampirewal.Core.MiniApi; + +internal class ExpressionTool +{ + internal static Func CreateMethodDelegate(MethodInfo method) + { + var mParameter = Expression.Parameter(typeof(TObj), "m"); + var mcExpression = Expression.Call(mParameter, method); + var reExpression = Expression.Convert(mcExpression, typeof(Tout)); + return Expression.Lambda>(reExpression, mParameter).Compile(); + } + + internal static Func CreateMethodDelegate(MethodInfo method) + { + var mParameter = Expression.Parameter(typeof(TObj), "m"); + var pParameter = Expression.Parameter(typeof(Tin), "p"); + var mcExpression = Expression.Call(mParameter, method, Expression.Convert(pParameter, typeof(Tin))); + var reExpression = Expression.Convert(mcExpression, typeof(Tout)); + return Expression.Lambda>(reExpression, mParameter, pParameter).Compile(); + } + + internal static Func CreateMethodDelegate(MethodInfo method) + { + var mParameter = Expression.Parameter(typeof(TObj), "m"); + var pParameter1 = Expression.Parameter(typeof(Tin1), "p1"); + var pParameter2 = Expression.Parameter(typeof(Tin2), "p2"); + var mcExpression = Expression.Call(mParameter, method, Expression.Convert(pParameter1, typeof(Tin1)), Expression.Convert(pParameter2, typeof(Tin2))); + var reExpression = Expression.Convert(mcExpression, typeof(Tout)); + return Expression.Lambda>(reExpression, mParameter, pParameter1, pParameter2).Compile(); + } + + internal static Delegate CreateMethodDelegate(Type type, MethodInfo method) + { + var classExp = Expression.Parameter(type, type.Name); + + List < ParameterExpression > parameters = new List < ParameterExpression >(); + + foreach (var item in method.GetParameters()) + { + var pParameter1 = Expression.Parameter(item.ParameterType, item.Name); + + //Expression.Convert(pParameter1, typeof(Tin1)) + + parameters.Add(pParameter1); + } + + var returnExpression = Expression.Call(classExp, method, parameters); + + parameters.Insert(0,classExp); + + return Expression.Lambda(returnExpression, parameters).Compile(); + } +} \ No newline at end of file diff --git a/Vampirewal.Core.MiniApi/HttpRouterAttribute.cs b/Vampirewal.Core.MiniApi/HttpRouterAttribute.cs new file mode 100644 index 0000000..8ccd08d --- /dev/null +++ b/Vampirewal.Core.MiniApi/HttpRouterAttribute.cs @@ -0,0 +1,88 @@ +#region << 文件说明 >> +/*---------------------------------------------------------------- + * 命名空间:Vampirewal.Core.MiniApi + * 唯一标识:f01dafe9-498d-47ad-aeba-7f9f711ec3ac + * 文件名:HttpRouterAttribute + * + * 创建者:杨程 + * 电子邮箱:235160615@qq.com + * 创建时间:2023/12/18 9:56:07 + * 版本:V1.0.0 + * 描述: + * + * ---------------------------------------------------------------- + * 修改人: + * 时间: + * 修改说明: + * + * 版本:V1.0.1 + *----------------------------------------------------------------*/ +#endregion << 文件说明 >> + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Vampirewal.Core.Attributes; + +namespace Vampirewal.Core.MiniApi; + +/// +/// +/// +[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] +public class VampirewalControllerAttribute : Attribute +{ + /// + /// + /// + /// 注册方式 + public VampirewalControllerAttribute(RegisterType registerType = RegisterType.Singleton) + { + this.registerType = registerType; + } + + /// + /// 注册方式 + /// + public RegisterType registerType { get; private set; } + + /// + /// 描述信息 + /// + public string Description { get; set; } + + /// + /// 描述控制器的名称 + /// + public string ControllerName { get; set; } +} + +/// +/// +/// +[AttributeUsage(AttributeTargets.Method)] +public class HttpRouterAttribute : Attribute +{ + internal string path; + internal HttpMethod httpMethod; + public HttpRouterAttribute(string path) + { + this.path = path; + this.httpMethod = HttpMethod.Post; + } + public HttpRouterAttribute(string path, HttpMethod httpMethod) + { + this.path = path; + this.httpMethod = httpMethod; + } +} + +public enum HttpMethod +{ + Get, + Post, + Put, + Delete, +} \ No newline at end of file diff --git a/Vampirewal.Core.MiniApi/IVampirewalRegisterMiniApi.cs b/Vampirewal.Core.MiniApi/IVampirewalRegisterMiniApi.cs new file mode 100644 index 0000000..a48c945 --- /dev/null +++ b/Vampirewal.Core.MiniApi/IVampirewalRegisterMiniApi.cs @@ -0,0 +1,42 @@ +#region << 文件说明 >> +/*---------------------------------------------------------------- + * 命名空间:Vampirewal.Core.MiniApi + * 唯一标识:78fa02ab-4ee0-43dc-853b-18829a10f896 + * 文件名:IVampirewalRegisterMiniApi + * + * 创建者:杨程 + * 电子邮箱:235160615@qq.com + * 创建时间:2023/12/19 13:12:23 + * 版本:V1.0.0 + * 描述: + * + * ---------------------------------------------------------------- + * 修改人: + * 时间: + * 修改说明: + * + * 版本:V1.0.1 + *----------------------------------------------------------------*/ +#endregion << 文件说明 >> + +using Microsoft.AspNetCore.Routing; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + + +namespace Vampirewal.Core.MiniApi; + +/// +/// +/// +public interface IVampirewalRegisterMiniApi +{ + /// + /// + /// + void RegisterMiniApi(IEndpointRouteBuilder endpoints); +} + diff --git a/Vampirewal.Core.MiniApi/Vampirewal.Core.MiniApi.csproj b/Vampirewal.Core.MiniApi/Vampirewal.Core.MiniApi.csproj new file mode 100644 index 0000000..47464f4 --- /dev/null +++ b/Vampirewal.Core.MiniApi/Vampirewal.Core.MiniApi.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + + diff --git a/Vampirewal.Core.MiniApi/VampirewalMiniApiBootStartup.cs b/Vampirewal.Core.MiniApi/VampirewalMiniApiBootStartup.cs new file mode 100644 index 0000000..97971e9 --- /dev/null +++ b/Vampirewal.Core.MiniApi/VampirewalMiniApiBootStartup.cs @@ -0,0 +1,220 @@ +#region << 文件说明 >> +/*---------------------------------------------------------------- + * 命名空间:Vampirewal.Core.MiniApi + * 唯一标识:80e600ed-f55d-4ed6-8a4c-1284d08d62ab + * 文件名:VampirewalMiniApiBootStartup + * + * 创建者:杨程 + * 电子邮箱:235160615@qq.com + * 创建时间:2023/12/18 9:48:24 + * 版本:V1.0.0 + * 描述: + * + * ---------------------------------------------------------------- + * 修改人: + * 时间: + * 修改说明: + * + * 版本:V1.0.1 + *----------------------------------------------------------------*/ +#endregion << 文件说明 >> + +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Routing; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.VisualBasic; +using NetTaste; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; +using System.Runtime.Loader; +using System.Text; +using System.Threading.Tasks; +using Vampirewal.Core.Attributes; +using Vampirewal.Core.Components; +using Vampirewal.Core.SimpleMVVM; + +namespace Vampirewal.Core.MiniApi; + +/// +/// +/// +public abstract class VampirewalMiniApiBootStartup : VampirewalBootStartUp, IVampirewalBootStartUp +{ + /// + /// 构建BootStartup并启动 + /// + /// + /// + public override void BuildBootStartUp() + { + if (IsStart) + { + throw new BootStartUpException("请勿重复调用!"); + } + + RegisterService(Collection); + + RegisterAll(Collection); + + RegisterMiniApiService(); + + var webApplicationBuilder= WebApplication.CreateBuilder(); + webApplicationBuilder.Host.ConfigureServices((ctx, ser) => + { + foreach (var item in Collection) + { + ser.Add(item); + } + + }); + + var webApplication= webApplicationBuilder.Build(); + + Configure(webApplication); + + #region 旧 + //var list = DynamicPorxyFactory.RegisterDynamicPorxy().ToList(); + + //list.ForEach(item => WebApplicationBuilderExtension.GetWebApplicationMap(item.Item1.httpMethod, webApplication)(item.Item1.path, item.Item2.Instance)); + #endregion + + #region new + + foreach (var item in MiniApiClass) + { + var miniapi= webApplication.Services.GetService(item) as IVampirewalRegisterMiniApi; + miniapi?.RegisterMiniApi(webApplication); + } + + #endregion + + + + SetServiceProvider(webApplication.Services); + + VampirewalCoreContext.GetInstance().SetService(Services); + + WindowsManager.GetInstance().OpenWindow(FirstViewKey, IsMainWindow: true); + + IsStart = true; + + //VampirewalCoreContext.GetInstance().GetOptions + + webApplication.RunAsync("http://*:9090"); + } + + /// + /// 配置中间件 + /// + /// + public abstract void Configure(IApplicationBuilder app); + + //public abstract void SetEndpointRouteBuilder(IEndpointRouteBuilder endpoint); + + private List MiniApiClass { get; set; } = new List(); + + private void RegisterMiniApiService() + { + var types = AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetTypes()).Where(w => w.GetInterface("IVampirewalRegisterMiniApi") != null).ToArray(); + + foreach (var type in types) + { + Collection.AddSingleton(type); + + MiniApiClass.Add(type); + } + } +} + + +internal class DynamicPorxyFactory +{ + internal static IEnumerable<(HttpRouterAttribute, DynamicPorxy)> RegisterDynamicPorxy() + { + var types = AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetTypes()).Where(w => w.GetCustomAttribute() != null).ToArray(); + + List<(HttpRouterAttribute, DynamicPorxy)> list = new List<(HttpRouterAttribute, DynamicPorxy)>(); + + foreach (var item in types) + { + var Attribute = item.GetCustomAttribute(); + + if (Attribute == null) + continue; + + var methods= item.GetMethods().Where(w => w.GetCustomAttribute() != null).ToList(); + + foreach (var methodinfo in methods) + { + var webRouter = methodinfo.GetCustomAttributes(typeof(HttpRouterAttribute), false).FirstOrDefault() as HttpRouterAttribute; + DynamicPorxy dynamicPorxy; + + var Im = methodinfo.DeclaringType; + var returnType = methodinfo.ReturnType; + + var Params= methodinfo.GetParameters(); + + var ParamTypes= Params.Select(p => p.ParameterType).ToList(); + ParamTypes.Insert(0,Im); + ParamTypes.Add(returnType); + + if (Params.Count() == 1) + { + dynamicPorxy = Activator.CreateInstance(typeof(DynamicPorxyImpl<,,>).MakeGenericType(ParamTypes.ToArray()), new object[] { methodinfo }) as DynamicPorxy; + } + else if (Params.Count() == 2) + { + dynamicPorxy = Activator.CreateInstance(typeof(DynamicPorxyImpl<,,,>).MakeGenericType(ParamTypes.ToArray()), new object[] { methodinfo }) as DynamicPorxy; + } + else + { + dynamicPorxy = Activator.CreateInstance(typeof(DynamicPorxyImpl<,>).MakeGenericType(Im, returnType), new object[] { methodinfo }) as DynamicPorxy; + } + + yield return (webRouter, dynamicPorxy); + + } + } + + } + +} + + + +internal static class WebApplicationBuilderExtension +{ + internal static Func GetWebApplicationMap(HttpMethod httpMethod, WebApplication webApplication) => (httpMethod) switch + { + (HttpMethod.Get) => webApplication.MapGet, + (HttpMethod.Post) => webApplication.MapPost, + (HttpMethod.Put) => webApplication.MapPut, + (HttpMethod.Delete) => webApplication.MapDelete, + _ => webApplication.MapGet + }; + + + public static WebApplication RegisterMiniApi(this WebApplicationBuilder webApplicationBuilder, Action registerDependencyAction) + { + webApplicationBuilder.Host.ConfigureServices((ctx, services) => + { + registerDependencyAction(services); + }); + var webApplication = webApplicationBuilder.Build(); + //mapProxyBuilder().ToList().ForEach(item => GetWebApplicationMap(item.webRouter.httpMethod, webApplication)(item.webRouter.path, item.dynamicPorxy.Instance)); + + var list = DynamicPorxyFactory.RegisterDynamicPorxy().ToList(); + + list.ForEach(item => GetWebApplicationMap(item.Item1.httpMethod, webApplication)(item.Item1.path, item.Item2.Instance)); + + + return webApplication; + } +} \ No newline at end of file diff --git a/Vampirewal.Core.sln b/Vampirewal.Core.sln index abcb849..b50f517 100644 --- a/Vampirewal.Core.sln +++ b/Vampirewal.Core.sln @@ -47,7 +47,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vampirewal.Core.ComputerInf EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vampirewal.Core.WebApi", "Vampirewal.Core.WebApi\Vampirewal.Core.WebApi.csproj", "{2F222061-D47C-4EA3-A57F-38AEA9E673FB}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vampirewal.Core.RuleEngine", "Vampirewal.Core.RuleEngine\Vampirewal.Core.RuleEngine.csproj", "{9A41DD48-A477-48A8-BB6C-09815A1B45F7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vampirewal.Core.RuleEngine", "Vampirewal.Core.RuleEngine\Vampirewal.Core.RuleEngine.csproj", "{9A41DD48-A477-48A8-BB6C-09815A1B45F7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vampirewal.Core.MiniApi", "Vampirewal.Core.MiniApi\Vampirewal.Core.MiniApi.csproj", "{13A4E1FB-97E6-402F-BA83-0CF938F4AD8D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -139,6 +141,10 @@ Global {9A41DD48-A477-48A8-BB6C-09815A1B45F7}.Debug|Any CPU.Build.0 = Debug|Any CPU {9A41DD48-A477-48A8-BB6C-09815A1B45F7}.Release|Any CPU.ActiveCfg = Release|Any CPU {9A41DD48-A477-48A8-BB6C-09815A1B45F7}.Release|Any CPU.Build.0 = Release|Any CPU + {13A4E1FB-97E6-402F-BA83-0CF938F4AD8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {13A4E1FB-97E6-402F-BA83-0CF938F4AD8D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {13A4E1FB-97E6-402F-BA83-0CF938F4AD8D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {13A4E1FB-97E6-402F-BA83-0CF938F4AD8D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -163,6 +169,7 @@ Global {D9820ED5-1F87-443B-91DB-C9C2333726E0} = {D70678FD-58AC-4EFF-B995-F27A6F15AF4B} {2F222061-D47C-4EA3-A57F-38AEA9E673FB} = {D70678FD-58AC-4EFF-B995-F27A6F15AF4B} {9A41DD48-A477-48A8-BB6C-09815A1B45F7} = {D70678FD-58AC-4EFF-B995-F27A6F15AF4B} + {13A4E1FB-97E6-402F-BA83-0CF938F4AD8D} = {D70678FD-58AC-4EFF-B995-F27A6F15AF4B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {F95EFBE7-9DF8-4104-AFCC-ADE3D80BD902} diff --git a/test.ViewModel/MainViewModel.cs b/test.ViewModel/MainViewModel.cs index 22fc340..89db97f 100644 --- a/test.ViewModel/MainViewModel.cs +++ b/test.ViewModel/MainViewModel.cs @@ -203,11 +203,11 @@ public partial class MainViewModel2 : BillVM public testNotify notify; //private ILogger Log { get; set; } - public MainViewModel2(IVampirewalCoreDialogMessage dialog, IVampirewalOperationExcelService operationExcel, IVampirewalCoreLogService logger, IVampirewalCoreEventBusFactory factory, IVampirewalCoreComputerService computer, IVampirewalRuleEngine rule, ITestInterface face) : base() + public MainViewModel2(IVampirewalCoreDialogMessage dialog, IVampirewalOperationExcelService operationExcel, IVampirewalCoreLogService logger, IVampirewalCoreEventBusFactory factory, IVampirewalCoreComputerService computer) : base() { - face.aaa(); + //face.aaa(); - rule.Run("haha", new TestModel() { Name = "傻屌" }); + //rule.Run("haha", new TestModel() { Name = "傻屌" }); logger.DebugLog("abc", "aaa"); @@ -381,15 +381,15 @@ public partial class MainViewModel2 : BillVM } } - public MainViewModel2() - { - //显示SetClassificationAttribute编号0-3的值 - ListViewButtonList = EnumHelper.EnumToList().Where(e => e.Classification >= 0 && e.Classification <= 3).OrderBy(e => e.Classification).ToList(); - //显示SetClassificationAttribute编号0-4的值 - ListViewButtonList = EnumHelper.EnumToList().Where(e => e.Classification >= 0 && e.Classification <= 4).OrderBy(e => e.Classification).ToList(); - //显示SetClassificationAttribute编号2-4的值 - ListViewButtonList = EnumHelper.EnumToList().Where(e => e.Classification >= 2 && e.Classification <= 4).OrderBy(e => e.Classification).ToList(); - } + //public MainViewModel2() + //{ + // //显示SetClassificationAttribute编号0-3的值 + // ListViewButtonList = EnumHelper.EnumToList().Where(e => e.Classification >= 0 && e.Classification <= 3).OrderBy(e => e.Classification).ToList(); + // //显示SetClassificationAttribute编号0-4的值 + // ListViewButtonList = EnumHelper.EnumToList().Where(e => e.Classification >= 0 && e.Classification <= 4).OrderBy(e => e.Classification).ToList(); + // //显示SetClassificationAttribute编号2-4的值 + // ListViewButtonList = EnumHelper.EnumToList().Where(e => e.Classification >= 2 && e.Classification <= 4).OrderBy(e => e.Classification).ToList(); + //} private MemoryMetrics _Memory; @@ -803,4 +803,10 @@ public class TestEventBusAopAttribute : EventBusAOPAttribute public interface ITestInterface { void aaa(); +} + +public interface IDispatcherService +{ + void BeginInvoke(Action act); + } \ No newline at end of file diff --git a/test.ViewModel/MiniApiController.cs b/test.ViewModel/MiniApiController.cs new file mode 100644 index 0000000..ff9ecf2 --- /dev/null +++ b/test.ViewModel/MiniApiController.cs @@ -0,0 +1,169 @@ +#region << 文件说明 >> +/*---------------------------------------------------------------- + * 命名空间:test.ViewModel + * 唯一标识:a90367fa-e0ec-4d4c-928a-e22ebdb67726 + * 文件名:MiniApiController + * + * 创建者:杨程 + * 电子邮箱:235160615@qq.com + * 创建时间:2023/12/18 12:53:59 + * 版本:V1.0.0 + * 描述: + * + * ---------------------------------------------------------------- + * 修改人: + * 时间: + * 修改说明: + * + * 版本:V1.0.1 + *----------------------------------------------------------------*/ +#endregion << 文件说明 >> + +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Routing; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Vampirewal.Core.Interface; +using Vampirewal.Core.MiniApi; +using Vampirewal.Core.SimpleMVVM; +using Vampirewal.Core.WebApi; + +namespace test.ViewModel; + +public interface IMiniApiController +{ + Task GetName(string name); + + Task GetAge(testInput age); +} + +/// +/// +/// +//[Vampirewal.Core.MiniApi.VampirewalController( Vampirewal.Core.Attributes.RegisterType.Singleton)] +public partial class MiniApiController:IVampirewalRegisterMiniApi +{ + /// + /// 构造函数 + /// + public MiniApiController() + { + + } + + public void RegisterMiniApi(IEndpointRouteBuilder endpoints) + { + endpoints.MapGet("/api/MiniApi/GetName", GetName).WithTags("shadiao"); + endpoints.MapGet("/GetAAA", GetAAA).WithTags("shadiao"); + endpoints.MapPost("/GetAge", GetAge).WithTags("shadiao"); + } + + /// + /// 测试获取 + /// + /// + /// + [HttpRouter("/api/MiniApi/GetName", Vampirewal.Core.MiniApi.HttpMethod.Get)] + public async Task GetName(string name) + { + return await Task.Run(() => + { + return $"{name}:你好!"; + }); + } + + /// + /// 测试获取 + /// + /// 年龄 + /// + [HttpRouter("/GetAge", Vampirewal.Core.MiniApi.HttpMethod.Post)] + public async Task GetAge(testInput age) + { + return await Task.Run(() => + { + return $"aaa:你好!{age.Age}"; + }); + } + + [HttpRouter("/GetAAA", Vampirewal.Core.MiniApi.HttpMethod.Get)] + public string GetAAA(string a, string b) + { + return $"{a}-{b}"; + } + + [HttpRouter("/GetBBB", Vampirewal.Core.MiniApi.HttpMethod.Get)] + public string GetBBB() + { + return $"asd"; + } + + + + #region [ 属性 ] + + #endregion + + #region [ 公开方法 ] + + #endregion + + #region [ 私有方法 ] + + #endregion + + #region [ Command命令 ] + + #endregion + +} + +public class MiniApi2 : IVampirewalRegisterMiniApi +{ + private IVampirewalCoreDialogMessage Dialog { get; set; } + private IDispatcherService Ds { get; set; } + + public MiniApi2(IVampirewalCoreDialogMessage dialog, IDispatcherService ds) + { + Dialog=dialog; + Ds=ds; + } + + public void RegisterMiniApi(IEndpointRouteBuilder endpoints) + { + endpoints.MapGet("/GetBBB", GetBBB); + } + + [HttpRouter("/GetBBB", Vampirewal.Core.MiniApi.HttpMethod.Get)] + public string GetBBB() + { + Ds.BeginInvoke(() => + { + Dialog.ShowPopupWindow(new Vampirewal.Core.WindoSetting.PopupWindowSetting() + { + Message = "测试弹窗", + OwnerWindow = WindowsManager.GetInstance().MainWindow, + Type = Vampirewal.Core.WindoSetting.MessageType.Successful + }); + }); + + + + return $"asd"; + } +} + +/// +/// ceshi +/// +public class testInput +{ + /// + /// 年龄 + /// + public int Age { get; set; } +} \ No newline at end of file diff --git a/test.ViewModel/TestBootStartUp.cs b/test.ViewModel/TestBootStartUp.cs index 0575cd3..30bef8d 100644 --- a/test.ViewModel/TestBootStartUp.cs +++ b/test.ViewModel/TestBootStartUp.cs @@ -27,23 +27,53 @@ using Vampirewal.Core.Extensions; using Vampirewal.Core.Interface; using Vampirewal.Core.Models; using Vampirewal.Core.OperationExcelService; -using Vampirewal.Core.WebApi; using System.Threading.Tasks; using Vampirewal.Core.RuleEngine; using System.Collections.Generic; using Vampirewal.Core.FlowEngine; using Vampirewal.Core; using Vampirewal.Core.Models.FlowEngine; +using Vampirewal.Core.MiniApi; +using Microsoft.AspNetCore.Builder; +using Microsoft.OpenApi.Models; +using System.IO; +using Microsoft.AspNetCore.Routing; +using System.ComponentModel; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Linq; +using System.Reflection; //using Vampirewal.Core.VContainer; namespace test.ViewModel; -public class TestBootStartUp : VampirewalWebApiBootStartup +public class TestBootStartUp : VampirewalMiniApiBootStartup { protected override string FirstViewKey => "MainView"; + public override void Configure(IApplicationBuilder app) + { + app.UseSwagger(); + app.UseSwaggerUI(c => + { + c.SwaggerEndpoint("/swagger/v1/swagger.json", "MiniApi"); + + c.EnablePersistAuthorization(); + }); + + + } + + //public override void SetEndpointRouteBuilder(IEndpointRouteBuilder endpoint) + //{ + // endpoint.MapGet("/GetName/{name}/{age}", (string name, int age) => + // { + // return $"{name}:傻屌,今年{age}岁"; + // }).WithTags("shadiao").WithName("傻屌"); + //} + protected override void RegisterService(IServiceCollection services) { @@ -90,49 +120,98 @@ public class TestBootStartUp : VampirewalWebApiBootStartup //services.AddVampirewalControllers().AddVampirewalApiResultProvider(); - services.UseVampirewalWebApi(config => - { - config.SetIpPort("*", 9999); + //services.UseVampirewalWebApi(config => + //{ + // config.SetIpPort("*", 9999); - config.AddVampirewalMiddleware(); - config.AddVampirewalMiddleware(); + // config.AddVampirewalMiddleware(); + // config.AddVampirewalMiddleware(); - config.UseWebApiDoc(new VampirewalApiDocOptions() - { - LocalPath = AppDomain.CurrentDomain.BaseDirectory, - Title = "测试", - Version = "1.0.0.1" - }); - }); + // config.UseWebApiDoc(new VampirewalApiDocOptions() + // { + // LocalPath = AppDomain.CurrentDomain.BaseDirectory, + // Title = "测试", + // Version = "1.0.0.1" + // }); + //}); - services.AddVampirewalRuleEngine(option => - { - option.RegisterRule("haha"); - }); + //services.AddVampirewalRuleEngine(option => + //{ + // option.RegisterRule("haha"); + //}); - services.AddVampirewalWorkFlowEngineServer(async op => - { - op.RegirstFlowType(0, "测试流程"); + //services.AddVampirewalWorkFlowEngineServer(async op => + //{ + // op.RegirstFlowType(0, "测试流程"); + + // op.FlowBuilder(flowBuilder); + + // op.RegisterFlowUnitExcutionMode(); + + //}); - op.FlowBuilder(flowBuilder); + services.AddSingleton< MiniApiController>(); - op.RegisterFlowUnitExcutionMode(); + services.AddEndpointsApiExplorer(); + services.AddSwaggerGen(c => + { + //c.DocInclusionPredicate((docName, apiDescription) => + //{ + + //}); + + c.SwaggerDoc("v1",new OpenApiInfo + { + Title = "测试MiniApi-V1", + Version = "v1", + Description="haha" + } + ); + //设置xml引用 + var filePath = Path.Combine(System.AppContext.BaseDirectory, "test.ViewModel.xml"); + c.IncludeXmlComments(filePath); + + //添加授权 + var schemeName = "Bearer"; + c.AddSecurityDefinition(schemeName, new OpenApiSecurityScheme + { + In = ParameterLocation.Header, + Description = "请输入不带有Bearer的Token", + Name = "Authorization", + Type = SecuritySchemeType.Http, + Scheme = schemeName.ToLowerInvariant(), + BearerFormat = "JWT" + }); + c.AddSecurityRequirement(new OpenApiSecurityRequirement { + { + new OpenApiSecurityScheme + { + Reference = new OpenApiReference + { + Type = ReferenceType.SecurityScheme, + Id = schemeName, + + } + }, + new string[0] + } + }); }); } private void flowBuilder(IVampirewalFlowBuilder bu) { - bu.Builder("ceshi001", "测试", 0, (nodes,param) => + bu.Builder("ceshi001", "测试", 0, (nodes, param) => { - nodes.SetStartNode( ExcutionModeType.EveryOne).SetNormalNode(1, "aa", "asd", ExcutionModeType.EveryOne,link => + nodes.SetStartNode(ExcutionModeType.EveryOne).SetNormalNode(1, "aa", "asd", ExcutionModeType.EveryOne, link => { link.SetPreviousUnitIndex(0).SetCondition(""); }); }); - + } } @@ -159,7 +238,7 @@ public class TestRule : IVampirewalRule public void Build(IVampirewalRuleBuilder data) { - data.StartWith().IfElse< TestIfElseSetp, TestIfElseSetp>(w=>w.Name== "傻屌"); + data.StartWith().IfElse(w => w.Name == "傻屌"); } } @@ -192,7 +271,7 @@ public class TestIfElseSetp : IVampirewalRuleSetp { context.Builder.IF(w => w.Name == "傻屌"); - + return VampirewalRuleExcuteResult.Next(); } diff --git a/test.ViewModel/test.ViewModel.csproj b/test.ViewModel/test.ViewModel.csproj index 48f5e5e..dbeb935 100644 --- a/test.ViewModel/test.ViewModel.csproj +++ b/test.ViewModel/test.ViewModel.csproj @@ -12,6 +12,7 @@ + diff --git a/test/MainWindow.xaml.cs b/test/MainWindow.xaml.cs index e61cef9..18e5da7 100644 --- a/test/MainWindow.xaml.cs +++ b/test/MainWindow.xaml.cs @@ -180,4 +180,16 @@ namespace test } } + + /// + /// + /// + [VampirewalIoCRegister(typeof(IDispatcherService))] + public partial class DispatcherService : IDispatcherService + { + public void BeginInvoke(Action act) + { + Application.Current.Dispatcher.BeginInvoke(act); + } + } } diff --git a/test/test.View.csproj b/test/test.View.csproj index c895d2e..4ca7900 100644 --- a/test/test.View.csproj +++ b/test/test.View.csproj @@ -38,7 +38,7 @@ - + -- Gitee