Skip to content

Commit

Permalink
包升级;废弃package,使用传统exe模式运行
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzhaoji committed Jul 17, 2023
1 parent aa798ca commit ec5320e
Show file tree
Hide file tree
Showing 25 changed files with 70 additions and 50 deletions.
14 changes: 5 additions & 9 deletions OMDb.Core/Helpers/ImageHelper.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
using ImageMagick;
using OMDb.Core.Const;
using OMDb.Core.Const;
using OMDb.Core.Models;
using OMDb.Core.Services;
using OMDb.Core.Utils.Extensions;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Processing.Processors;
using System.Net;
using ImageInfo = OMDb.Core.Models.ImageInfo;

namespace OMDb.Core.Helpers
{
Expand All @@ -17,12 +13,12 @@ public static void GetImageSize(string path, out double Wpx, out double Hpx)
{
try
{
MagickImageInfo image = new MagickImageInfo(path);
ImageMagick.MagickImageInfo image = new ImageMagick.MagickImageInfo(path);
int w = image.Width;//宽
int h = image.Height;//高
Wpx = image.Density.X;//分辨率
Hpx = image.Density.Y;//分辨率
if (image.Density.Units == DensityUnit.PixelsPerCentimeter)//判断分辨率单位
if (image.Density.Units == ImageMagick.DensityUnit.PixelsPerCentimeter)//判断分辨率单位
{
Wpx *= 2.54;
Hpx *= 2.54;
Expand All @@ -38,7 +34,7 @@ public static ImageInfo GetImageInfo(string path)
try
{
ImageInfo imageInfo = new ImageInfo();
MagickImageInfo image = new MagickImageInfo(path);
ImageMagick.MagickImageInfo image = new ImageMagick.MagickImageInfo(path);
imageInfo.Width = image.Width;
imageInfo.Height = image.Height;
imageInfo.FullPath = path;
Expand Down
4 changes: 1 addition & 3 deletions OMDb.Core/Helpers/RandomHelper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Google.Protobuf.WellKnownTypes;
using Org.BouncyCastle.Utilities;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
Expand Down
18 changes: 9 additions & 9 deletions OMDb.Core/OMDb.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@

<ItemGroup>
<PackageReference Include="DotNetCore.NPOI" Version="1.2.3" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.46" />
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="12.2.1" />
<PackageReference Include="Magick.NET.Core" Version="12.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="NLog" Version="5.1.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
<PackageReference Include="SqlSugarCore" Version="5.1.3.34" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.49" />
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="13.1.3" />
<PackageReference Include="Magick.NET.Core" Version="13.1.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NLog" Version="5.2.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.1" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.91" />
<PackageReference Include="System.Composition.AttributedModel" Version="7.0.0" />
<PackageReference Include="System.Composition.Convention" Version="7.0.0" />
<PackageReference Include="System.Composition.TypedParts" Version="7.0.0" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.117" />
<PackageReference Include="Xabe.FFmpeg" Version="5.2.0" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.118" />
<PackageReference Include="Xabe.FFmpeg" Version="5.2.6" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion OMDb.Core/Services/DbService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Org.BouncyCastle.Math.EC.ECCurve;

namespace OMDb.Core.Services
{
Expand Down
4 changes: 1 addition & 3 deletions OMDb.Core/Utils/Logger.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Google.Protobuf.WellKnownTypes;
using Org.BouncyCastle.Utilities;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
Expand Down
4 changes: 2 additions & 2 deletions OMDb.Douban/OMDb.Douban.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.46" />
<PackageReference Include="NLog" Version="5.1.2" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.49" />
<PackageReference Include="NLog" Version="5.2.2" />
<PackageReference Include="System.Composition.AttributedModel" Version="7.0.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
using OMDb.WinUI3.Services;
using OMDb.WinUI3.Services.Settings;
using OMDb.WinUI3.ViewModels;
using Org.BouncyCastle.Utilities;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
Expand Down
12 changes: 11 additions & 1 deletion OMDb.WinUI3/OMDb.WinUI3/Helpers/WindowHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.UI.Xaml;
using System;
using System.Collections.Generic;

namespace OMDb.WinUI3.Helpers
Expand Down Expand Up @@ -45,6 +46,15 @@ public static void SetMainWindow(Window window)
{
MainWindow = window;
}

public static IntPtr GetWindowHandle(Window window)
{
return WinRT.Interop.WindowNative.GetWindowHandle(window);
}
public static Microsoft.UI.Windowing.AppWindow GetAppWindow(Window window)
{
var hWnd = GetWindowHandle(window);
Microsoft.UI.WindowId windowId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(hWnd);
return Microsoft.UI.Windowing.AppWindow.GetFromWindowId(windowId);
}
}
}
1 change: 0 additions & 1 deletion OMDb.WinUI3/OMDb.WinUI3/MyControls/StorageCard.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using OMDb.WinUI3.Helpers;
using OMDb.WinUI3.Models;
using OMDb.WinUI3.ViewModels;
using Org.BouncyCastle.Asn1.X509;
using System;
using System.Collections.Generic;
using System.IO;
Expand Down
26 changes: 22 additions & 4 deletions OMDb.WinUI3/OMDb.WinUI3/OMDb.WinUI3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<UseWinUI>true</UseWinUI>
<BaseOutputPath>bin\</BaseOutputPath>
<PublishProfile>Properties\PublishProfiles\win10-$(Platform).pubxml</PublishProfile>
<!--package需注释掉-->
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<WindowsPackageType>None</WindowsPackageType>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<AssemblyName>OMDb</AssemblyName>
<!--package需注释掉-->
</PropertyGroup>
<ItemGroup>
<Compile Remove="Enums\**" />
Expand Down Expand Up @@ -94,13 +102,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.0.0" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
<PackageReference Include="CommunityToolkit.WinUI.UI.Controls" Version="7.1.2" />
<PackageReference Include="DotNetCore.NPOI" Version="1.2.3" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221116.1" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.3.230602002" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" />
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
<PackageReference Include="Xabe.FFmpeg" Version="5.2.0" />
<PackageReference Include="Xabe.FFmpeg" Version="5.2.6" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>

Expand Down Expand Up @@ -372,10 +380,20 @@
<Folder Include="Assets\FFmpeg\" />
</ItemGroup>

<ItemGroup>
<None Include="Properties\PublishProfiles\win10-x64.pubxml.user" />
</ItemGroup>

<ItemGroup>
<Page Update="MyControls\ExplorerControl.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<None Update="logo_32.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="logo_32.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="nlog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
7 changes: 7 additions & 0 deletions OMDb.WinUI3/OMDb.WinUI3/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"profiles": {
"OMDb": {
"commandName": "Project"
}
}
}
2 changes: 1 addition & 1 deletion OMDb.WinUI3/OMDb.WinUI3/Services/ActivationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static class ActivationService
{
public static void Init()
{
Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "zh-CN";
//Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "zh-CN";
ConfigService.Load();
//SettingService.Load();
RecentFileService.Init();
Expand Down
1 change: 0 additions & 1 deletion OMDb.WinUI3/OMDb.WinUI3/Services/ConfigService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Newtonsoft.Json;
using OMDb.WinUI3.Models;
using OMDb.WinUI3.Services.Settings;
using Org.BouncyCastle.Utilities;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
Expand Down
3 changes: 1 addition & 2 deletions OMDb.WinUI3/OMDb.WinUI3/Services/ExcelService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Google.Protobuf.WellKnownTypes;
using ICSharpCode.SharpZipLib.Core;
using ICSharpCode.SharpZipLib.Core;
using NPOI.OpenXmlFormats.Vml;
using NPOI.POIFS.FileSystem;
using NPOI.SS.Formula;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using CommunityToolkit.Mvvm.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Media.Imaging;
using MySqlX.XDevAPI.Common;
using OMDb.Core.Enums;
using OMDb.Core.Helpers;
using OMDb.Core.Models;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Google.Protobuf.WellKnownTypes;
using Microsoft.UI.Xaml.Controls;
using OMDb.Core.DbModels;
using OMDb.Core.Models;
Expand Down
3 changes: 0 additions & 3 deletions OMDb.WinUI3/OMDb.WinUI3/ViewModels/LabelPropertyViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Microsoft.UI.Xaml.Media;
using MySqlX.XDevAPI.Common;
using Newtonsoft.Json;
using OMDb.WinUI3.Models;
using OMDb.WinUI3.Services;
Expand All @@ -14,7 +13,6 @@
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
//using Microsoft.UI.Xaml.Media;
using Microsoft.UI;
using System.Xml.Linq;
using Microsoft.UI.Xaml;
Expand All @@ -24,7 +22,6 @@
using OMDb.WinUI3.Services.Settings;
using System.ComponentModel.Design;
using OMDb.Core.DbModels;
using Org.BouncyCastle.Crypto;

namespace OMDb.WinUI3.ViewModels
{
Expand Down
2 changes: 0 additions & 2 deletions OMDb.WinUI3/OMDb.WinUI3/ViewModels/LabelViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Microsoft.UI.Xaml.Media;
using MySqlX.XDevAPI.Common;
using Newtonsoft.Json;
using OMDb.WinUI3.Models;
using OMDb.WinUI3.Services;
Expand All @@ -14,7 +13,6 @@
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
//using Microsoft.UI.Xaml.Media;
using Microsoft.UI;
using System.Xml.Linq;
using Microsoft.UI.Xaml;
Expand Down
1 change: 0 additions & 1 deletion OMDb.WinUI3/OMDb.WinUI3/ViewModels/StorageViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Google.Protobuf.WellKnownTypes;
using Newtonsoft.Json;
using OMDb.Core.DbModels;
using OMDb.Core.Models;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using MySqlX.XDevAPI.Common;
using OMDb.Core.Services;
using OMDb.Core.Utils;
using OMDb.Core.Utils.Extensions;
Expand Down
1 change: 0 additions & 1 deletion OMDb.WinUI3/OMDb.WinUI3/Views/Tools/ToolPageBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ubiety.Dns.Core;

namespace OMDb.WinUI3.Views.Tools
{
Expand Down
3 changes: 3 additions & 0 deletions OMDb.WinUI3/OMDb.WinUI3/Wins/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using OMDb.Core.Services.PluginsService;
using OMDb.WinUI3.Helpers;
using OMDb.WinUI3.Services;
using System;
using System.Runtime.InteropServices; // For DllImport
using WinRT; // required to support Window.As<ICompositionSupportsSystemBackdrop>()

Expand All @@ -16,6 +18,7 @@ public MainWindow()
{
this.InitializeComponent();
this.Title = "OMDb";
WindowHelper.GetAppWindow(this).SetIcon(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logo_32.ico"));
Helpers.WindowHelper.TrackWindow(this);
Helpers.WindowHelper.SetMainWindow(this);
ExtendsContentIntoTitleBar = true;
Expand Down
9 changes: 7 additions & 2 deletions OMDb.WinUI3/OMDb.WinUI3/app.manifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="OMDb.WinUI3.app"/>

<assemblyIdentity version="1.0.0.0" name="OMDb.WinUI3.app"/>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 and Windows 11 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<!-- The combination of below two tags have the following effect:
Expand Down
Binary file added OMDb.WinUI3/OMDb.WinUI3/logo_32.ico
Binary file not shown.
Binary file added OMDb.WinUI3/OMDb.WinUI3/logo_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ec5320e

Please sign in to comment.