Skip to content

Commit 31423cc

Browse files
committed
升级到.NET 5
1 parent d237f6a commit 31423cc

File tree

100 files changed

+26232
-1563
lines changed

Some content is hidden

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

100 files changed

+26232
-1563
lines changed

AfterBuild/MapBoard.AfterBuild.csproj

Lines changed: 7 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,29 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
42
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{AAAF24F7-327D-45DD-A8D7-9750BEA582E1}</ProjectGuid>
3+
<TargetFramework>net5.0</TargetFramework>
84
<OutputType>Exe</OutputType>
9-
<RootNamespace>MapBoard.AfterBuild</RootNamespace>
105
<AssemblyName>AfterBuild</AssemblyName>
11-
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
12-
<FileAlignment>512</FileAlignment>
13-
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14-
<Deterministic>true</Deterministic>
6+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
157
</PropertyGroup>
168
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17-
<PlatformTarget>AnyCPU</PlatformTarget>
18-
<DebugSymbols>true</DebugSymbols>
19-
<DebugType>full</DebugType>
20-
<Optimize>false</Optimize>
219
<OutputPath>..\Generation\Debug\</OutputPath>
22-
<DefineConstants>DEBUG;TRACE</DefineConstants>
23-
<ErrorReport>prompt</ErrorReport>
24-
<WarningLevel>4</WarningLevel>
2510
</PropertyGroup>
2611
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27-
<PlatformTarget>AnyCPU</PlatformTarget>
28-
<DebugType>pdbonly</DebugType>
29-
<Optimize>true</Optimize>
3012
<OutputPath>..\Generation\Release\</OutputPath>
31-
<DefineConstants>TRACE</DefineConstants>
32-
<ErrorReport>prompt</ErrorReport>
33-
<WarningLevel>4</WarningLevel>
3413
</PropertyGroup>
3514
<ItemGroup>
36-
<Reference Include="FzDesktopLib.Windows, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
37-
<SpecificVersion>False</SpecificVersion>
38-
<HintPath>..\libs\FzDesktopLib.Windows.dll</HintPath>
15+
<Reference Include="FzCoreLib.Windows">
16+
<HintPath>..\libs\FzCoreLib.Windows.dll</HintPath>
3917
</Reference>
4018
<Reference Include="FzStandardLib">
4119
<HintPath>..\libs\FzStandardLib.dll</HintPath>
4220
</Reference>
43-
<Reference Include="System" />
44-
<Reference Include="System.Core" />
45-
<Reference Include="System.Xml.Linq" />
46-
<Reference Include="System.Data.DataSetExtensions" />
47-
<Reference Include="Microsoft.CSharp" />
48-
<Reference Include="System.Data" />
49-
<Reference Include="System.Net.Http" />
50-
<Reference Include="System.Xml" />
51-
</ItemGroup>
52-
<ItemGroup>
53-
<Compile Include="Program.cs" />
54-
<Compile Include="Properties\AssemblyInfo.cs" />
55-
</ItemGroup>
56-
<ItemGroup>
57-
<None Include="App.config" />
5821
</ItemGroup>
5922
<ItemGroup>
23+
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
6024
<PackageReference Include="Newtonsoft.Json">
6125
<Version>13.0.1</Version>
6226
</PackageReference>
27+
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
6328
</ItemGroup>
64-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
6529
</Project>

AfterBuild/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//#define TEST
22

3+
using FzLib.IO;
34
using FzLib.Program;
45
using Newtonsoft.Json;
56
using System;

Common/BaseLayer/GeoViewHelper.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using Esri.ArcGISRuntime.Geometry;
22
using Esri.ArcGISRuntime.Mapping;
33
using Esri.ArcGISRuntime.UI.Controls;
4-
using FzLib.UI.Dialog;
5-
using ModernWpf.FzExtension.CommonDialog;
64
using System;
75
using System.Linq;
86
using System.Threading.Tasks;

Common/Dialog/DialogWindowBase.cs renamed to Common/DialogWindowBase.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
using FzLib.UI.Extension;
2-
using ModernWpf.Controls.Primitives;
1+
using ModernWpf.Controls.Primitives;
2+
using System.ComponentModel;
33
using System.Linq;
44
using System.Windows;
55

6-
namespace MapBoard.Common.Dialog
6+
namespace MapBoard.Common
77
{
8-
public class DialogWindowBase : ExtendedWindow
8+
public class DialogWindowBase : WindowBase, INotifyPropertyChanged
99
{
1010
public DialogWindowBase()
1111
{
@@ -20,5 +20,7 @@ public DialogWindowBase()
2020
WindowStyle = WindowStyle.ToolWindow;
2121
ShowInTaskbar = false;
2222
}
23+
24+
public event PropertyChangedEventHandler PropertyChanged;
2325
}
2426
}

Common/MainWindowBase.cs

Lines changed: 0 additions & 17 deletions
This file was deleted.

Common/MapBoard.Common.csproj

Lines changed: 15 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,24 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
42
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{7F99EF14-0E45-4D03-99BB-F9D918A9A0AD}</ProjectGuid>
3+
<TargetFramework>net5.0-windows10.0.18362.0</TargetFramework>
84
<OutputType>Library</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>MapBoard.Common</RootNamespace>
11-
<AssemblyName>MapBoard.Common</AssemblyName>
12-
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
14-
<Deterministic>true</Deterministic>
15-
<NuGetPackageImportStamp>
16-
</NuGetPackageImportStamp>
17-
<TargetFrameworkProfile />
5+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
6+
<UseWPF>true</UseWPF>
7+
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
188
</PropertyGroup>
199
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
20-
<DebugSymbols>true</DebugSymbols>
21-
<DebugType>full</DebugType>
22-
<Optimize>false</Optimize>
2310
<OutputPath>..\Generation\Debug\</OutputPath>
24-
<DefineConstants>DEBUG;TRACE</DefineConstants>
25-
<ErrorReport>prompt</ErrorReport>
26-
<WarningLevel>4</WarningLevel>
2711
<LangVersion>preview</LangVersion>
28-
<NoWarn>CS0067;CS4014;CS0168</NoWarn>
12+
<NoWarn>CS0067;CS4014;CS0168;CA1416</NoWarn>
13+
<WarningLevel>4</WarningLevel>
2914
</PropertyGroup>
3015
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
31-
<DebugType>pdbonly</DebugType>
32-
<Optimize>true</Optimize>
3316
<OutputPath>..\Generation\Release\</OutputPath>
34-
<DefineConstants>TRACE</DefineConstants>
35-
<ErrorReport>prompt</ErrorReport>
36-
<WarningLevel>4</WarningLevel>
3717
<LangVersion>8.0</LangVersion>
3818
</PropertyGroup>
3919
<ItemGroup>
40-
<Reference Include="FzDesktopLib.Windows">
41-
<HintPath>..\libs\FzDesktopLib.Windows.dll</HintPath>
20+
<Reference Include="FzCoreLib.Windows">
21+
<HintPath>..\libs\FzCoreLib.Windows.dll</HintPath>
4222
</Reference>
4323
<Reference Include="FzGeographyLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
4424
<SpecificVersion>False</SpecificVersion>
@@ -48,9 +28,6 @@
4828
<SpecificVersion>False</SpecificVersion>
4929
<HintPath>..\libs\FzStandardLib.dll</HintPath>
5030
</Reference>
51-
<Reference Include="FzUILib.WPF">
52-
<HintPath>..\libs\FzUILib.WPF.dll</HintPath>
53-
</Reference>
5431
<Reference Include="GeoAPI, Version=1.7.5.0, Culture=neutral, PublicKeyToken=a1a0da7def465678, processorArchitecture=MSIL">
5532
<SpecificVersion>False</SpecificVersion>
5633
<HintPath>..\libs\GeoAPI.dll</HintPath>
@@ -59,64 +36,21 @@
5936
<SpecificVersion>False</SpecificVersion>
6037
<HintPath>..\libs\GeoAPI.CoordinateSystems.dll</HintPath>
6138
</Reference>
62-
<Reference Include="netstandard" />
63-
<Reference Include="NetTopologySuite, Version=2.0.0.0, Culture=neutral, PublicKeyToken=f580a05016ebada1" />
64-
<Reference Include="PresentationCore" />
65-
<Reference Include="PresentationFramework" />
66-
<Reference Include="System" />
67-
<Reference Include="System.Core" />
68-
<Reference Include="System.Drawing" />
69-
<Reference Include="System.Xaml" />
70-
<Reference Include="System.Xml.Linq" />
71-
<Reference Include="System.Data.DataSetExtensions" />
72-
<Reference Include="Microsoft.CSharp" />
73-
<Reference Include="System.Data" />
74-
<Reference Include="System.Net.Http" />
75-
<Reference Include="System.Xml" />
76-
<Reference Include="WindowsBase" />
77-
</ItemGroup>
78-
<ItemGroup>
79-
<Compile Include="BaseLayer\BaseLayerHelper.cs" />
80-
<Compile Include="BaseLayer\GeoViewHelper.cs" />
81-
<Compile Include="Config.cs" />
82-
<Compile Include="CoordinateTransformation.cs" />
83-
<Compile Include="Dialog\DialogWindowBase.cs" />
84-
<Compile Include="MainWindowBase.cs" />
85-
<Compile Include="Properties\AssemblyInfo.cs" />
86-
<Compile Include="Resource.Designer.cs">
87-
<DependentUpon>Resource.resx</DependentUpon>
88-
<AutoGen>True</AutoGen>
89-
<DesignTime>True</DesignTime>
90-
</Compile>
9139
</ItemGroup>
9240
<ItemGroup>
93-
<None Include="app.config" />
94-
</ItemGroup>
95-
<ItemGroup>
96-
<EmbeddedResource Include="Resource.resx">
97-
<Generator>PublicResXFileCodeGenerator</Generator>
98-
<LastGenOutput>Resource.Designer.cs</LastGenOutput>
99-
</EmbeddedResource>
100-
</ItemGroup>
101-
<ItemGroup>
102-
<PackageReference Include="Esri.ArcGISRuntime">
103-
<Version>100.11.0</Version>
104-
</PackageReference>
105-
<PackageReference Include="Esri.ArcGISRuntime.WPF">
106-
<Version>100.11.0</Version>
107-
</PackageReference>
41+
<PackageReference Include="Esri.ArcGISRuntime.WPF" Version="100.11.0" />
42+
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
10843
<PackageReference Include="ModernWpfUI">
10944
<Version>0.9.4</Version>
11045
</PackageReference>
46+
<PackageReference Include="NetTopologySuite" Version="2.2.0" />
11147
<PackageReference Include="Newtonsoft.Json">
11248
<Version>13.0.1</Version>
11349
</PackageReference>
50+
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
51+
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
11452
</ItemGroup>
11553
<ItemGroup>
116-
<ProjectReference Include="..\ModernWpf.FzExtension\ModernWpf.FzExtension.csproj">
117-
<Project>{f5d99d6b-c794-4e2d-bb07-172d2ee954bb}</Project>
118-
<Name>ModernWpf.FzExtension</Name>
119-
</ProjectReference>
54+
<ProjectReference Include="..\ModernWpf.FzExtension\ModernWpf.FzExtension.csproj" />
12055
</ItemGroup>
121-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
12256
</Project>

Common/WindowBase.cs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
using System;
2+
using System.ComponentModel;
3+
using System.Windows;
4+
using System.Windows.Controls;
5+
6+
namespace MapBoard.Common
7+
{
8+
public abstract class UserControlBase : UserControl, INotifyPropertyChanged
9+
{
10+
public UserControlBase()
11+
{
12+
DataContext = this;
13+
}
14+
15+
public event PropertyChangedEventHandler PropertyChanged;
16+
}
17+
18+
public abstract class WindowBase : Window, INotifyPropertyChanged
19+
{
20+
public WindowBase()
21+
{
22+
DataContext = this;
23+
}
24+
25+
public event PropertyChangedEventHandler PropertyChanged;
26+
27+
public bool IsClosed { get; private set; }
28+
29+
protected override void OnClosed(EventArgs e)
30+
{
31+
base.OnClosed(e);
32+
IsClosed = true;
33+
}
34+
35+
public void BringToFront()
36+
{
37+
if (!IsVisible)
38+
{
39+
Show();
40+
}
41+
42+
if (WindowState == WindowState.Minimized)
43+
{
44+
WindowState = WindowState.Normal;
45+
}
46+
47+
Activate();
48+
Topmost = true; // important
49+
Topmost = false; // important
50+
Focus();
51+
}
52+
}
53+
}

0 commit comments

Comments
 (0)