Commit bb17756a by liulongfei

球员列表

球队列表
parent 10cf34a6
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Domain;
using VIZ.TVP.Golf.Storage;
namespace VIZ.TVP.Golf.Domain
{
/// <summary>
/// 应用程序域
/// </summary>
public class ApplicationDomainEx : ApplicationDomain
{
/// <summary>
/// 球员信息列表
/// </summary>
public static ObservableCollection<PlayerInfoModel> PlayerInfos { get; set; }
/// <summary>
/// 队伍信息列表
/// </summary>
public static ObservableCollection<TeamInfoModel> TeamInfos { get; set; }
/// <summary>
/// LiteDB数据库
/// </summary>
public static LiteDBContext LiteDBContext { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.Framework.Storage;
using VIZ.TVP.Golf.Storage;
namespace VIZ.TVP.Golf.Domain
{
/// <summary>
/// 球员信息模型
/// </summary>
public class PlayerInfoModel : ModelBase
{
public PlayerInfoModel()
{
}
/// <summary>
/// 实体
/// </summary>
public PlayerInfo Entity { get; set; }
#region PlayerID -- 球员编号
private int playerID;
/// <summary>
/// 球员编号
/// </summary>
public int PlayerID
{
get { return playerID; }
set { playerID = value; this.RaisePropertyChanged(nameof(PlayerID)); }
}
#endregion
#region Name -- 名称
private string name;
/// <summary>
/// 名称
/// </summary>
public string Name
{
get { return name; }
set { name = value; this.RaisePropertyChanged(nameof(Name)); }
}
#endregion
#region Age -- 年龄
private int age;
/// <summary>
/// 年龄
/// </summary>
public int Age
{
get { return age; }
set { age = value; this.RaisePropertyChanged(nameof(Age)); }
}
#endregion
#region Sex -- 性别
private SexEnum sex;
/// <summary>
/// 性别
/// </summary>
public SexEnum Sex
{
get { return sex; }
set { sex = value; this.RaisePropertyChanged(nameof(Sex)); }
}
#endregion
#region Country -- 国家
private string country;
/// <summary>
/// 国家
/// </summary>
public string Country
{
get { return country; }
set { country = value; this.RaisePropertyChanged(nameof(Country)); }
}
#endregion
#region FullPicture -- 全身照
private string fullPicture;
/// <summary>
/// 全身照
/// </summary>
public string FullPicture
{
get { return fullPicture; }
set { fullPicture = value; this.RaisePropertyChanged(nameof(FullPicture)); }
}
#endregion
#region HalfPicture -- 半身照
private string halfPicture;
/// <summary>
/// 半身照
/// </summary>
public string HalfPicture
{
get { return halfPicture; }
set { halfPicture = value; this.RaisePropertyChanged(nameof(HalfPicture)); }
}
#endregion
#region TeamModel -- 球队模型
#endregion
/// <summary>
/// 更新属性值实体模型
/// </summary>
public void UpdatePropertyToEntity()
{
this.Entity.PlayerID = this.PlayerID;
this.Entity.Name = this.Name;
this.Entity.Age = this.Age;
this.Entity.Sex = this.Sex;
this.Entity.Country = this.Country;
this.Entity.FullPicture = this.FullPicture;
this.Entity.HalfPicture = this.HalfPicture;
}
/// <summary>
/// 从实体模型更新数据
/// </summary>
public void UpdatePropertyFromEntity()
{
this.PlayerID = this.Entity.PlayerID;
this.Name = this.Entity.Name;
this.Age = this.Entity.Age;
this.Sex = this.Entity.Sex;
this.Country = this.Entity.Country;
this.FullPicture = this.Entity.FullPicture;
this.HalfPicture = this.Entity.HalfPicture;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Storage;
namespace VIZ.TVP.Golf.Domain
{
/// <summary>
/// 队伍信息模型
/// </summary>
public class TeamInfoModel : ModelBase
{
/// <summary>
/// 实体
/// </summary>
public TeamInfo Entity { get; set; }
#region TeamID -- 队伍编号
private int teamID;
/// <summary>
/// 队伍编号
/// </summary>
public int TeamID
{
get { return teamID; }
set { teamID = value; this.RaisePropertyChanged(nameof(TeamID)); }
}
#endregion
#region Name -- 名称
private string name;
/// <summary>
/// 名称
/// </summary>
public string Name
{
get { return name; }
set { name = value; this.RaisePropertyChanged(nameof(Name)); }
}
#endregion
#region Picture -- 照片
private string picture;
/// <summary>
/// 照片
/// </summary>
public string Picture
{
get { return picture; }
set { picture = value; this.RaisePropertyChanged(nameof(Picture)); }
}
#endregion
/// <summary>
/// 更新属性值实体模型
/// </summary>
public void UpdatePropertyToEntity()
{
this.Entity.TeamID = this.TeamID;
this.Entity.Name = this.Name;
this.Entity.Picture = this.Picture;
}
/// <summary>
/// 从实体模型更新数据
/// </summary>
public void UpdatePropertyFromEntity()
{
this.TeamID = this.Entity.TeamID;
this.Name = this.Entity.Name;
this.Picture = this.Entity.Picture;
}
}
}
......@@ -64,20 +64,36 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ApplicationDomainEx.cs" />
<Compile Include="Model\EntityModel\PlayerInfoModel.cs" />
<Compile Include="Model\EntityModel\TeamInfoModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Core\VIZ.Framework.Core.csproj">
<Project>{75b39591-4bc3-4b09-bd7d-ec9f67efa96e}</Project>
<Name>VIZ.Framework.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Domain\VIZ.Framework.Domain.csproj">
<Project>{28661e82-c86a-4611-a028-c34f6ac85c97}</Project>
<Name>VIZ.Framework.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Storage\VIZ.Framework.Storage.csproj">
<Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project>
<Name>VIZ.Framework.Storage</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Golf.Core\VIZ.TVP.Golf.Core.csproj">
<Project>{56d41597-a835-4195-a53f-ce7b3fc27839}</Project>
<Name>VIZ.TVP.Golf.Core</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Golf.Storage\VIZ.TVP.Golf.Storage.csproj">
<Project>{96040211-e7a3-4aa1-8227-529afb65fa78}</Project>
<Name>VIZ.TVP.Golf.Storage</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("VIZ.TVP.Golf.Module.Resource")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VIZ.TVP.Golf.Module.Resource")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
//若要开始生成可本地化的应用程序,请设置
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
//例如,如果您在源文件中使用的是美国英语,
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
//对以下 NeutralResourceLanguage 特性的注释。 更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(未在页面中找到资源时使用,
//或应用程序资源字典中找到时使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(未在页面中找到资源时使用,
//、应用程序或任何主题专用资源字典中找到时使用)
)]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace VIZ.TVP.Golf.Module.Resource.Properties {
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if ((resourceMan == null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VIZ.TVP.Golf.Module.Resource.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VIZ.TVP.Golf.Module.Resource.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
\ No newline at end of file
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:VIZ.TVP.Golf.Module.Resource">
</ResourceDictionary>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{21F2A416-8D25-4EA9-8B49-23030D2E70CF}</ProjectGuid>
<OutputType>library</OutputType>
<RootNamespace>VIZ.TVP.Golf.Module.Resource</RootNamespace>
<AssemblyName>VIZ.TVP.Golf.Module.Resource</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Xceed.Wpf.AvalonDock, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Core\VIZ.Framework.Core.csproj">
<Project>{75b39591-4bc3-4b09-bd7d-ec9f67efa96e}</Project>
<Name>VIZ.Framework.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Domain\VIZ.Framework.Domain.csproj">
<Project>{28661e82-c86a-4611-a028-c34f6ac85c97}</Project>
<Name>VIZ.Framework.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Module\VIZ.Framework.Module.csproj">
<Project>{47cf6fb0-e37d-4ef1-afc7-03db2bca8892}</Project>
<Name>VIZ.Framework.Module</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Storage\VIZ.Framework.Storage.csproj">
<Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project>
<Name>VIZ.Framework.Storage</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Golf.Core\VIZ.TVP.Golf.Core.csproj">
<Project>{56d41597-a835-4195-a53f-ce7b3fc27839}</Project>
<Name>VIZ.TVP.Golf.Core</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Golf.Domain\VIZ.TVP.Golf.Domain.csproj">
<Project>{455e59f6-e208-4dea-bb36-b419dee0133f}</Project>
<Name>VIZ.TVP.Golf.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Golf.Module\VIZ.TVP.Golf.Module.csproj">
<Project>{f9f79f33-b05f-40ec-8099-ece3fb61446f}</Project>
<Name>VIZ.TVP.Golf.Module</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.TVP.Golf.Storage\VIZ.TVP.Golf.Storage.csproj">
<Project>{96040211-e7a3-4aa1-8227-529afb65fa78}</Project>
<Name>VIZ.TVP.Golf.Storage</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Converter\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Extended.Wpf.Toolkit" version="4.4.0" targetFramework="net48" />
<package id="log4net" version="2.0.14" targetFramework="net48" />
</packages>
\ No newline at end of file
<UserControl x:Class="VIZ.TVP.Golf.Module.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VIZ.TVP.Golf.Module"
d:DataContext="{d:DesignInstance Type=local:MainViewModel}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<local:TeamListView></local:TeamListView>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// MainView.xaml 的交互逻辑
/// </summary>
public partial class MainView : UserControl
{
public MainView()
{
InitializeComponent();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 主视图模型
/// </summary>
public class MainViewModel : ViewModelBase
{
}
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.TVP.Golf.Domain;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 球员列表支持
/// </summary>
public interface IPlayerListSupport
{
/// <summary>
/// 球员信息列表
/// </summary>
ObservableCollection<PlayerInfoModel> PlayerInfos { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Domain;
using VIZ.TVP.Golf.Domain;
using VIZ.TVP.Golf.Storage;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 球员列表控制器
/// </summary>
public class PlayerListController
{
/// <summary>
/// 球员列表控制器
/// </summary>
/// <param name="support">支持</param>
public PlayerListController(IPlayerListSupport support)
{
this.Support = support;
}
/// <summary>
/// 支持
/// </summary>
public IPlayerListSupport Support { get; private set; }
/// <summary>
/// 将数据保存值数据库
/// </summary>
public void SaveToDB()
{
lock (ApplicationDomainEx.PlayerInfos)
{
foreach (PlayerInfoModel model in ApplicationDomainEx.PlayerInfos)
{
model.UpdatePropertyToEntity();
ApplicationDomainEx.LiteDBContext.PlayerInfos.Upsert(model.Entity);
}
}
}
/// <summary>
/// 从数据库中加载数据
/// </summary>
public void LoadFromDB()
{
lock (ApplicationDomainEx.PlayerInfos)
{
Dictionary<int, PlayerInfoModel> dic = ApplicationDomainEx.PlayerInfos.ToDictionary(p => p.Entity.ID);
var query = ApplicationDomainEx.LiteDBContext.PlayerInfos.FindAll();
foreach (PlayerInfo entity in query)
{
if (!dic.TryGetValue(entity.ID, out PlayerInfoModel model))
{
model = new PlayerInfoModel();
ApplicationDomainEx.PlayerInfos.Add(model);
}
model.Entity = entity;
model.UpdatePropertyFromEntity();
}
}
}
}
}
<UserControl x:Class="VIZ.TVP.Golf.Module.PlayerListView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:storage="clr-namespace:VIZ.TVP.Golf.Storage;assembly=VIZ.TVP.Golf.Storage"
xmlns:local="clr-namespace:VIZ.TVP.Golf.Module"
d:DataContext="{d:DesignInstance Type=local:PlayerListViewModel}"
mc:Ignorable="d"
x:Name="uc"
d:DesignHeight="800" d:DesignWidth="1200">
<UserControl.Resources>
<core:Enum2EnumDescriptionConverter x:Key="Enum2EnumDescriptionConverter" EnumType="{x:Type storage:SexEnum}"></core:Enum2EnumDescriptionConverter>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="300"></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal">
<Button Width="120" Height="30" Content="加载测试数据" Command="{Binding LoadTestDataCommand}"></Button>
<Button Width="120" Height="30" Content="加载远程数据" Command="{Binding LoadRemoteDataCommand}" Margin="20,0,0,0"></Button>
<Button Width="120" Height="30" Content="加载本地数据" Command="{Binding LoadLocalDataCommand}" Margin="20,0,0,0"></Button>
<Button Width="120" Height="30" Content="保存数据" Command="{Binding SaveLocalDataCommand}" Margin="20,0,0,0"></Button>
</StackPanel>
<!-- 数据表格 -->
<DataGrid Grid.Row="1" CanUserAddRows="False" AutoGenerateColumns="False"
ItemsSource="{Binding Path=PlayerInfos,Mode=OneWay}" FontSize="14"
SelectedValue="{Binding Path=SelectedPlayerInfo,Mode=TwoWay}">
<DataGrid.Columns>
<DataGridTextColumn Header="球员编号" Width="80" Binding="{Binding Path=PlayerID,Mode=TwoWay}"></DataGridTextColumn>
<DataGridTextColumn Header="姓名" Width="200" Binding="{Binding Path=Name,Mode=TwoWay}"></DataGridTextColumn>
<DataGridTextColumn Header="年龄" Width="80" Binding="{Binding Path=Age,Mode=TwoWay}"></DataGridTextColumn>
<DataGridComboBoxColumn Header="性别" Width="80"
SelectedItemBinding="{Binding Path=Sex,Mode=TwoWay,Converter={StaticResource Enum2EnumDescriptionConverter}}"
ItemsSource="{Binding Source={x:Static Member=storage:StaticEnumInfos.SexEnumDescriptions}}"></DataGridComboBoxColumn>
<DataGridTextColumn Header="国家" Width="120" Binding="{Binding Path=Country,Mode=TwoWay}"></DataGridTextColumn>
<DataGridTextColumn Header="全身照" Width="200" Binding="{Binding Path=FullPicture,Mode=TwoWay}"></DataGridTextColumn>
<DataGridTextColumn Header="半身照" Width="200" Binding="{Binding Path=HalfPicture,Mode=TwoWay}"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VIZ.Framework.Core;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// PlayerListView.xaml 的交互逻辑
/// </summary>
public partial class PlayerListView : UserControl
{
public PlayerListView()
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new PlayerListViewModel());
}
}
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
using VIZ.TVP.Golf.Storage;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 球员列表视图模型
/// </summary>
public class PlayerListViewModel : ViewModelBase, IPlayerListSupport
{
public PlayerListViewModel()
{
// 初始化属性
this.InitProperty();
// 初始化控制器
this.InitController();
// 初始化命令
this.InitCommand();
}
/// <summary>
/// 初始化命令
/// </summary>
private void InitCommand()
{
this.LoadTestDataCommand = new VCommand(this.LoadTestData);
this.LoadLocalDataCommand = new VCommand(this.LoadLocalData);
this.LoadRemoteDataCommand = new VCommand(this.LoadRemoteData);
this.SaveLocalDataCommand = new VCommand(this.SaveLocalData);
}
/// <summary>
/// 初始化属性
/// </summary>
private void InitProperty()
{
this.PlayerInfos = ApplicationDomainEx.PlayerInfos;
}
/// <summary>
/// 初始化控制器
/// </summary>
private void InitController()
{
this.playerListController = new PlayerListController(this);
}
// =====================================================================================
// Controller
// =====================================================================================
/// <summary>
/// 球员列表控制器
/// </summary>
private PlayerListController playerListController;
// =====================================================================================
// Property
// =====================================================================================
#region PlayerInfos -- 球员信息列表
private ObservableCollection<PlayerInfoModel> playerInfos;
/// <summary>
/// 球员信息列表
/// </summary>
public ObservableCollection<PlayerInfoModel> PlayerInfos
{
get { return playerInfos; }
set { playerInfos = value; this.RaisePropertyChanged(nameof(PlayerInfos)); }
}
#endregion
#region SelectedPlayerInfo -- 选中的球员信息
private PlayerInfoModel selectedPlayerInfo;
/// <summary>
/// 选中的球员信息
/// </summary>
public PlayerInfoModel SelectedPlayerInfo
{
get { return selectedPlayerInfo; }
set { selectedPlayerInfo = value; this.RaisePropertyChanged(nameof(SelectedPlayerInfo)); }
}
#endregion
// =====================================================================================
// Command
// =====================================================================================
#region LoadTestDataCommand -- 加载测试数据命令
/// <summary>
/// 加载测试数据命令
/// </summary>
public VCommand LoadTestDataCommand { get; set; }
/// <summary>
/// 加载测试
/// </summary>
private void LoadTestData()
{
this.PlayerInfos.Add(new PlayerInfoModel { PlayerID = 1, Name = "zhangsan", Sex = SexEnum.Female, Age = 15, Country = "China", Entity = new PlayerInfo() });
this.PlayerInfos.Add(new PlayerInfoModel { PlayerID = 1, Name = "lisi", Sex = SexEnum.Male, Age = 15, Country = "China", Entity = new PlayerInfo() });
}
#endregion
#region LoadLocalDataCommand -- 加载本地数据命令
/// <summary>
/// 加载本地数据命令
/// </summary>
public VCommand LoadLocalDataCommand { get; set; }
/// <summary>
/// 加载本地数据命令
/// </summary>
private void LoadLocalData()
{
this.playerListController.LoadFromDB();
}
#endregion
#region LoadRemoteDataCommand -- 加载远程数据命令
/// <summary>
/// 加载远程数据命令
/// </summary>
public VCommand LoadRemoteDataCommand { get; set; }
/// <summary>
/// 加载远程数据
/// </summary>
private void LoadRemoteData()
{
}
#endregion
#region SaveLocalDataCommand -- 保存本地数据命令
/// <summary>
/// 保存本地数据命令
/// </summary>
public VCommand SaveLocalDataCommand { get; set; }
/// <summary>
/// 保存本地数据
/// </summary>
private void SaveLocalData()
{
this.playerListController.SaveToDB();
}
#endregion
}
}
using log4net;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.Framework.Module;
using VIZ.TVP.Golf.Domain;
using VIZ.TVP.Golf.Storage;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 应用程序启动 -- 初始化LiteDB
/// </summary>
public class AppSetup_InitLiteDB : AppSetupBase
{
/// <summary>
/// 日志
/// </summary>
private static ILog log = LogManager.GetLogger(typeof(AppSetup_InitLiteDB));
/// <summary>
/// 描述
/// </summary>
public override string Detail { get; } = "应用程序启动 -- 初始化LiteDB";
/// <summary>
/// 执行启动
/// </summary>
/// <param name="context">应用程序启动上下文</param>
/// <returns>是否成功执行</returns>
public override bool Setup(AppSetupContext context)
{
string dir = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "db");
if (!System.IO.Directory.Exists(dir))
{
System.IO.Directory.CreateDirectory(dir);
}
string path = System.IO.Path.Combine(dir, "cache.db");
ApplicationDomainEx.LiteDBContext = new LiteDBContext(path);
// 初始化球员信息
this.InitPlayerInfos();
// 初始化球队信息
this.InitTeamInfos();
return true;
}
/// <summary>
/// 执行关闭
/// </summary>
/// <param name="context">应用程序启动上下文</param>
public override void Shutdown(AppSetupContext context)
{
ApplicationDomainEx.LiteDBContext?.Dispose();
ApplicationDomainEx.LiteDBContext = null;
}
/// <summary>
/// 初始化球员信息
/// </summary>
private void InitPlayerInfos()
{
ObservableCollection<PlayerInfoModel> list = new ObservableCollection<PlayerInfoModel>();
foreach (PlayerInfo entity in ApplicationDomainEx.LiteDBContext.PlayerInfos.FindAll())
{
PlayerInfoModel model = new PlayerInfoModel();
model.Entity = entity;
model.UpdatePropertyFromEntity();
list.Add(model);
}
ApplicationDomainEx.PlayerInfos = list;
}
/// <summary>
/// 初始化球队信息
/// </summary>
private void InitTeamInfos()
{
ObservableCollection<TeamInfoModel> list = new ObservableCollection<TeamInfoModel>();
foreach (TeamInfo entity in ApplicationDomainEx.LiteDBContext.TeamInfos.FindAll())
{
TeamInfoModel model = new TeamInfoModel();
model.Entity = entity;
model.UpdatePropertyFromEntity();
list.Add(model);
}
ApplicationDomainEx.TeamInfos = list;
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 队伍列表支持
/// </summary>
public interface ITeamListSupport
{
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.TVP.Golf.Domain;
using VIZ.TVP.Golf.Storage;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 队伍列表控制器
/// </summary>
public class TeamListController
{
/// <summary>
/// 队伍列表控制器
/// </summary>
/// <param name="support">支持</param>
public TeamListController(ITeamListSupport support)
{
this.Support = support;
}
/// <summary>
/// 支持
/// </summary>
public ITeamListSupport Support { get; private set; }
/// <summary>
/// 将数据保存值数据库
/// </summary>
public void SaveToDB()
{
lock (ApplicationDomainEx.TeamInfos)
{
foreach (TeamInfoModel model in ApplicationDomainEx.TeamInfos)
{
model.UpdatePropertyToEntity();
ApplicationDomainEx.LiteDBContext.TeamInfos.Upsert(model.Entity);
}
}
}
/// <summary>
/// 从数据库中加载数据
/// </summary>
public void LoadFromDB()
{
lock (ApplicationDomainEx.TeamInfos)
{
Dictionary<int, TeamInfoModel> dic = ApplicationDomainEx.TeamInfos.ToDictionary(p => p.Entity.ID);
var query = ApplicationDomainEx.LiteDBContext.TeamInfos.FindAll();
foreach (TeamInfo entity in query)
{
if (!dic.TryGetValue(entity.ID, out TeamInfoModel model))
{
model = new TeamInfoModel();
ApplicationDomainEx.TeamInfos.Add(model);
}
model.Entity = entity;
model.UpdatePropertyFromEntity();
}
}
}
}
}
\ No newline at end of file
<UserControl x:Class="VIZ.TVP.Golf.Module.TeamListView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:storage="clr-namespace:VIZ.TVP.Golf.Storage;assembly=VIZ.TVP.Golf.Storage"
xmlns:local="clr-namespace:VIZ.TVP.Golf.Module"
d:DataContext="{d:DesignInstance Type=local:TeamListViewModel}"
mc:Ignorable="d"
x:Name="uc"
d:DesignHeight="800" d:DesignWidth="1200">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="300"></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal">
<Button Width="120" Height="30" Content="加载测试数据" Command="{Binding LoadTestDataCommand}"></Button>
<Button Width="120" Height="30" Content="加载远程数据" Command="{Binding LoadRemoteDataCommand}" Margin="20,0,0,0"></Button>
<Button Width="120" Height="30" Content="加载本地数据" Command="{Binding LoadLocalDataCommand}" Margin="20,0,0,0"></Button>
<Button Width="120" Height="30" Content="保存数据" Command="{Binding SaveLocalDataCommand}" Margin="20,0,0,0"></Button>
</StackPanel>
<!-- 数据表格 -->
<DataGrid Grid.Row="1" CanUserAddRows="False" AutoGenerateColumns="False"
ItemsSource="{Binding Path=TeamInfos,Mode=OneWay}" FontSize="14"
SelectedValue="{Binding Path=SelectedTeamInfo,Mode=TwoWay}">
<DataGrid.Columns>
<DataGridTextColumn Header="球队编号" Width="80" Binding="{Binding Path=TeamID,Mode=TwoWay}"></DataGridTextColumn>
<DataGridTextColumn Header="名称" Width="200" Binding="{Binding Path=Name,Mode=TwoWay}"></DataGridTextColumn>
<DataGridTextColumn Header="照片" Width="80" Binding="{Binding Path=Picture,Mode=TwoWay}"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</UserControl>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VIZ.Framework.Core;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// TeamListView.xaml 的交互逻辑
/// </summary>
public partial class TeamListView : UserControl
{
public TeamListView()
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new TeamListViewModel());
}
}
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.TVP.Golf.Domain;
using VIZ.TVP.Golf.Storage;
namespace VIZ.TVP.Golf.Module
{
/// <summary>
/// 队伍列表视图模型
/// </summary>
public class TeamListViewModel : ViewModelBase, ITeamListSupport
{
public TeamListViewModel()
{
// 初始化属性
this.InitProperty();
// 初始化控制器
this.InitController();
// 初始化命令
this.InitCommand();
}
/// <summary>
/// 初始化命令
/// </summary>
private void InitCommand()
{
this.LoadTestDataCommand = new VCommand(this.LoadTestData);
this.LoadLocalDataCommand = new VCommand(this.LoadLocalData);
this.LoadRemoteDataCommand = new VCommand(this.LoadRemoteData);
this.SaveLocalDataCommand = new VCommand(this.SaveLocalData);
}
/// <summary>
/// 初始化属性
/// </summary>
private void InitProperty()
{
this.TeamInfos = ApplicationDomainEx.TeamInfos;
}
/// <summary>
/// 初始化控制器
/// </summary>
private void InitController()
{
this.teamListController = new TeamListController(this);
}
// =====================================================================================
// Controller
// =====================================================================================
/// <summary>
/// 队伍列表控制器
/// </summary>
private TeamListController teamListController;
// =====================================================================================
// Property
// =====================================================================================
#region TeamInfos -- 球员信息列表
private ObservableCollection<TeamInfoModel> teamInfos;
/// <summary>
/// 球员信息列表
/// </summary>
public ObservableCollection<TeamInfoModel> TeamInfos
{
get { return teamInfos; }
set { teamInfos = value; this.RaisePropertyChanged(nameof(TeamInfos)); }
}
#endregion
#region SelectedTeamInfo -- 选中的球员信息
private TeamInfoModel selectedTeamInfo;
/// <summary>
/// 选中的球员信息
/// </summary>
public TeamInfoModel SelectedTeamInfo
{
get { return selectedTeamInfo; }
set { selectedTeamInfo = value; this.RaisePropertyChanged(nameof(SelectedTeamInfo)); }
}
#endregion
// =====================================================================================
// Command
// =====================================================================================
#region LoadTestDataCommand -- 加载测试数据命令
/// <summary>
/// 加载测试数据命令
/// </summary>
public VCommand LoadTestDataCommand { get; set; }
/// <summary>
/// 加载测试
/// </summary>
private void LoadTestData()
{
this.TeamInfos.Add(new TeamInfoModel { TeamID = 1, Name = "队伍1", Entity = new TeamInfo() });
this.TeamInfos.Add(new TeamInfoModel { TeamID = 2, Name = "队伍2", Entity = new TeamInfo() });
}
#endregion
#region LoadLocalDataCommand -- 加载本地数据命令
/// <summary>
/// 加载本地数据命令
/// </summary>
public VCommand LoadLocalDataCommand { get; set; }
/// <summary>
/// 加载本地数据命令
/// </summary>
private void LoadLocalData()
{
this.teamListController.LoadFromDB();
}
#endregion
#region LoadRemoteDataCommand -- 加载远程数据命令
/// <summary>
/// 加载远程数据命令
/// </summary>
public VCommand LoadRemoteDataCommand { get; set; }
/// <summary>
/// 加载远程数据
/// </summary>
private void LoadRemoteData()
{
}
#endregion
#region SaveLocalDataCommand -- 保存本地数据命令
/// <summary>
/// 保存本地数据命令
/// </summary>
public VCommand SaveLocalDataCommand { get; set; }
/// <summary>
/// 保存本地数据
/// </summary>
private void SaveLocalData()
{
this.teamListController.SaveToDB();
}
#endregion
}
}
\ No newline at end of file
......@@ -50,12 +50,16 @@
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="LiteDB, Version=5.0.12.0, Culture=neutral, PublicKeyToken=4ee40123013c9f27, processorArchitecture=MSIL">
<HintPath>..\packages\LiteDB.5.0.12\lib\net45\LiteDB.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Runtime" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
......@@ -69,14 +73,51 @@
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Xceed.Wpf.AvalonDock, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Page Include="Main\View\MainView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Player\View\PlayerListView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Team\View\TeamListView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Main\ViewModel\MainViewModel.cs" />
<Compile Include="Main\View\MainView.xaml.cs">
<DependentUpon>MainView.xaml</DependentUpon>
</Compile>
<Compile Include="Player\Controller\IPlayerListSupport.cs" />
<Compile Include="Player\Controller\PlayerListController.cs" />
<Compile Include="Player\View\PlayerListView.xaml.cs">
<DependentUpon>PlayerListView.xaml</DependentUpon>
</Compile>
<Compile Include="Player\ViewModel\PlayerListViewModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
......@@ -90,10 +131,18 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="Setup\Provider\Setup\AppSetup_InitLiteDB.cs" />
<Compile Include="Team\Controller\ITeamListSupport.cs" />
<Compile Include="Team\Controller\TeamListController.cs" />
<Compile Include="Team\ViewModel\TeamListViewModel.cs" />
<Compile Include="Team\View\TeamListView.xaml.cs">
<DependentUpon>TeamListView.xaml</DependentUpon>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
......@@ -146,5 +195,6 @@
<Name>VIZ.TVP.Golf.Storage</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Extended.Wpf.Toolkit" version="4.4.0" targetFramework="net48" />
<package id="LiteDB" version="5.0.12" targetFramework="net48" />
<package id="log4net" version="2.0.14" targetFramework="net48" />
</packages>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Golf.Storage
{
/// <summary>
/// 性别枚举
/// </summary>
public enum SexEnum
{
/// <summary>
/// 女
/// </summary>
[Description("女")]
Female = 0,
/// <summary>
/// 男
/// </summary>
[Description("男")]
Male = 1
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.TVP.Golf.Storage
{
/// <summary>
/// 静态枚举信息集合
/// </summary>
public static class StaticEnumInfos
{
/// <summary>
/// 性别枚举模型集合
/// </summary>
public static List<EnumModel> SexEnumModels { get; } = EnumHelper.GetEnumModels<SexEnum>();
/// <summary>
/// 性别枚举描述集合
/// </summary>
public static List<string> SexEnumDescriptions { get; } = EnumHelper.GetEnumModels<SexEnum>().Select(p => p.Description).ToList();
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Storage;
namespace VIZ.TVP.Golf.Storage
{
/// <summary>
/// 客户端配置
/// </summary>
public class ClientConfig : IniConfigBase
{
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LiteDB;
namespace VIZ.TVP.Golf.Storage
{
/// <summary>
/// 洞信息
/// </summary>
public class HoleInfo
{
/// <summary>
/// 编号
/// </summary>
[BsonId(autoId: true)]
public int ID { get; set; }
/// <summary>
/// 洞编号
/// </summary>
public int HoleID { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LiteDB;
namespace VIZ.TVP.Golf.Storage
{
/// <summary>
/// 球员信息
/// </summary>
public class PlayerInfo
{
/// <summary>
/// 用户ID
/// </summary>
[BsonId(autoId: true)]
public int ID { get; set; }
/// <summary>
/// 球员编号
/// </summary>
public int PlayerID { get; set; }
/// <summary>
/// 所属队伍ID
/// </summary>
public int TeamID { get; set; }
/// <summary>
/// 球员名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 年龄
/// </summary>
public int Age { get; set; }
/// <summary>
/// 性别
/// </summary>
public SexEnum Sex { get; set; }
/// <summary>
/// 国家
/// </summary>
public string Country { get; set; }
/// <summary>
/// 全身照路径(相对路径)
/// </summary>
public string FullPicture { get; set; }
/// <summary>
/// 半身照路径(相对路径)
/// </summary>
public string HalfPicture { get; set; }
}
}
using LiteDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.TVP.Golf.Storage
{
/// <summary>
/// 排名信息
/// </summary>
public class RankingInfo
{
/// <summary>
/// 编号
/// </summary>
[BsonId(autoId: true)]
public int ID { get; set; }
/// <summary>
/// 比赛日
/// </summary>
public DateTime Date { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LiteDB;
namespace VIZ.TVP.Golf.Storage
{
/// <summary>
/// 队伍信息
/// </summary>
public class TeamInfo
{
/// <summary>
/// 编号
/// </summary>
[BsonId(autoId: true)]
public int ID { get; set; }
/// <summary>
/// 队伍ID
/// </summary>
public int TeamID { get; set; }
/// <summary>
/// 队伍名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 队伍照片
/// </summary>
public string Picture { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LiteDB;
using log4net;
namespace VIZ.TVP.Golf.Storage
{
/// <summary>
/// LiteDB上下文
/// </summary>
public class LiteDBContext : IDisposable
{
/// <summary>
/// 日志
/// </summary>
private static ILog log = LogManager.GetLogger(typeof(LiteDBContext));
/// <summary>
/// 数据库
/// </summary>
private ILiteDatabase Database;
/// <summary>
/// LiteDB 上下文
/// </summary>
/// <param name="path">数据库路径</param>
public LiteDBContext(string path)
{
this.Path = path;
this.Database = new LiteDatabase(path);
this.HoleInfos = this.Database.GetCollection<HoleInfo>();
this.PlayerInfos = this.Database.GetCollection<PlayerInfo>();
this.RankingInfos = this.Database.GetCollection<RankingInfo>();
this.TeamInfos = this.Database.GetCollection<TeamInfo>();
}
/// <summary>
/// 路径
/// </summary>
public string Path { get; private set; }
/// <summary>
/// 洞信息
/// </summary>
public ILiteCollection<HoleInfo> HoleInfos { get; private set; }
/// <summary>
/// 球员信息
/// </summary>
public ILiteCollection<PlayerInfo> PlayerInfos { get; private set; }
/// <summary>
/// 排名信息
/// </summary>
public ILiteCollection<RankingInfo> RankingInfos { get; private set; }
/// <summary>
/// 队伍信息
/// </summary>
public ILiteCollection<TeamInfo> TeamInfos { get; private set; }
/// <summary>
/// 销毁
/// </summary>
public void Dispose()
{
this.HoleInfos = null;
this.PlayerInfos = null;
this.RankingInfos = null;
this.TeamInfos = null;
this.Database?.Dispose();
this.Database = null;
}
}
}
......@@ -49,12 +49,16 @@
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="LiteDB, Version=5.0.12.0, Culture=neutral, PublicKeyToken=4ee40123013c9f27, processorArchitecture=MSIL">
<HintPath>..\packages\LiteDB.5.0.12\lib\net45\LiteDB.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
......@@ -64,12 +68,24 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Enum\StaticEnumInfos.cs" />
<Compile Include="Enum\SexEnum.cs" />
<Compile Include="Ini\ClientConfig.cs" />
<Compile Include="LiteDB\Entity\HoleInfo.cs" />
<Compile Include="LiteDB\LiteDBContext.cs" />
<Compile Include="LiteDB\Entity\PlayerInfo.cs" />
<Compile Include="LiteDB\Entity\RankingInfo.cs" />
<Compile Include="LiteDB\Entity\TeamInfo.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Core\VIZ.Framework.Core.csproj">
<Project>{75b39591-4bc3-4b09-bd7d-ec9f67efa96e}</Project>
<Name>VIZ.Framework.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Storage\VIZ.Framework.Storage.csproj">
<Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project>
<Name>VIZ.Framework.Storage</Name>
......@@ -79,5 +95,8 @@
<Name>VIZ.TVP.Golf.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="CSV\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="LiteDB" version="5.0.12" targetFramework="net48" />
<package id="log4net" version="2.0.14" targetFramework="net48" />
</packages>
\ No newline at end of file
......@@ -4,6 +4,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 17.3.32825.248
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "00-Doc", "00-Doc", "{CAE00ECF-BA01-4461-AE78-617D2977BEA0}"
ProjectSection(SolutionItems) = preProject
高尔夫球数据获取api.xml = 高尔夫球数据获取api.xml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "05-Lib", "05-Lib", "{5EC530D3-BA38-4C9A-AD51-4F458373A455}"
EndProject
......@@ -19,9 +22,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "50-Connection", "50-Connect
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "60-Module", "60-Module", "{97EF3462-638D-43A2-91F0-A8711C3B2441}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "70-Product", "70-Product", "{D73ABBE5-EE61-40F4-B3F5-CF0B92A029D4}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "80-Product", "80-Product", "{D73ABBE5-EE61-40F4-B3F5-CF0B92A029D4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "80-Tool", "80-Tool", "{58B6E71C-8803-4B3A-9C80-8B4F34B6D63C}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "85-Tool", "85-Tool", "{58B6E71C-8803-4B3A-9C80-8B4F34B6D63C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "90-Test", "90-Test", "{C8BC2310-EC1F-4740-B0E1-5D1970CB8ABC}"
EndProject
......@@ -51,6 +54,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.Framework.Connection",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.Framework.Module", "..\VIZ.Framework\VIZ.Framework.Module\VIZ.Framework.Module.csproj", "{47CF6FB0-E37D-4EF1-AFC7-03DB2BCA8892}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "70-TVP", "70-TVP", "{B2591788-4947-4FE8-9BCE-D19402638450}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.Framework.TVP", "..\VIZ.Framework\VIZ.Framework.TVP\VIZ.Framework.TVP.csproj", "{38B69125-343F-4DDA-AE90-9BF4B21BF875}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.Framework.TVP.Golf", "..\VIZ.Framework\VIZ.Framework.TVP.Golf\VIZ.Framework.TVP.Golf.csproj", "{6FBD7D1A-C16E-486B-A98C-727C09E514B8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.Framework.WpfTest", "..\VIZ.Framework\VIZ.Framework.WpfTest\VIZ.Framework.WpfTest.csproj", "{B62C822E-701F-480F-BBB1-0E02217D622C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VIZ.TVP.Golf.Module.Resource", "VIZ.TVP.Golf.Module.Resource\VIZ.TVP.Golf.Module.Resource.csproj", "{21F2A416-8D25-4EA9-8B49-23030D2E70CF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -217,6 +230,54 @@ Global
{47CF6FB0-E37D-4EF1-AFC7-03DB2BCA8892}.Release|x64.Build.0 = Release|x64
{47CF6FB0-E37D-4EF1-AFC7-03DB2BCA8892}.Release|x86.ActiveCfg = Release|Any CPU
{47CF6FB0-E37D-4EF1-AFC7-03DB2BCA8892}.Release|x86.Build.0 = Release|Any CPU
{38B69125-343F-4DDA-AE90-9BF4B21BF875}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{38B69125-343F-4DDA-AE90-9BF4B21BF875}.Debug|Any CPU.Build.0 = Debug|Any CPU
{38B69125-343F-4DDA-AE90-9BF4B21BF875}.Debug|x64.ActiveCfg = Debug|x64
{38B69125-343F-4DDA-AE90-9BF4B21BF875}.Debug|x64.Build.0 = Debug|x64
{38B69125-343F-4DDA-AE90-9BF4B21BF875}.Debug|x86.ActiveCfg = Debug|Any CPU
{38B69125-343F-4DDA-AE90-9BF4B21BF875}.Debug|x86.Build.0 = Debug|Any CPU
{38B69125-343F-4DDA-AE90-9BF4B21BF875}.Release|Any CPU.ActiveCfg = Release|Any CPU
{38B69125-343F-4DDA-AE90-9BF4B21BF875}.Release|Any CPU.Build.0 = Release|Any CPU
{38B69125-343F-4DDA-AE90-9BF4B21BF875}.Release|x64.ActiveCfg = Release|x64
{38B69125-343F-4DDA-AE90-9BF4B21BF875}.Release|x64.Build.0 = Release|x64
{38B69125-343F-4DDA-AE90-9BF4B21BF875}.Release|x86.ActiveCfg = Release|Any CPU
{38B69125-343F-4DDA-AE90-9BF4B21BF875}.Release|x86.Build.0 = Release|Any CPU
{6FBD7D1A-C16E-486B-A98C-727C09E514B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6FBD7D1A-C16E-486B-A98C-727C09E514B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6FBD7D1A-C16E-486B-A98C-727C09E514B8}.Debug|x64.ActiveCfg = Debug|x64
{6FBD7D1A-C16E-486B-A98C-727C09E514B8}.Debug|x64.Build.0 = Debug|x64
{6FBD7D1A-C16E-486B-A98C-727C09E514B8}.Debug|x86.ActiveCfg = Debug|Any CPU
{6FBD7D1A-C16E-486B-A98C-727C09E514B8}.Debug|x86.Build.0 = Debug|Any CPU
{6FBD7D1A-C16E-486B-A98C-727C09E514B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6FBD7D1A-C16E-486B-A98C-727C09E514B8}.Release|Any CPU.Build.0 = Release|Any CPU
{6FBD7D1A-C16E-486B-A98C-727C09E514B8}.Release|x64.ActiveCfg = Release|x64
{6FBD7D1A-C16E-486B-A98C-727C09E514B8}.Release|x64.Build.0 = Release|x64
{6FBD7D1A-C16E-486B-A98C-727C09E514B8}.Release|x86.ActiveCfg = Release|Any CPU
{6FBD7D1A-C16E-486B-A98C-727C09E514B8}.Release|x86.Build.0 = Release|Any CPU
{B62C822E-701F-480F-BBB1-0E02217D622C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B62C822E-701F-480F-BBB1-0E02217D622C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B62C822E-701F-480F-BBB1-0E02217D622C}.Debug|x64.ActiveCfg = Debug|x64
{B62C822E-701F-480F-BBB1-0E02217D622C}.Debug|x64.Build.0 = Debug|x64
{B62C822E-701F-480F-BBB1-0E02217D622C}.Debug|x86.ActiveCfg = Debug|Any CPU
{B62C822E-701F-480F-BBB1-0E02217D622C}.Debug|x86.Build.0 = Debug|Any CPU
{B62C822E-701F-480F-BBB1-0E02217D622C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B62C822E-701F-480F-BBB1-0E02217D622C}.Release|Any CPU.Build.0 = Release|Any CPU
{B62C822E-701F-480F-BBB1-0E02217D622C}.Release|x64.ActiveCfg = Release|x64
{B62C822E-701F-480F-BBB1-0E02217D622C}.Release|x64.Build.0 = Release|x64
{B62C822E-701F-480F-BBB1-0E02217D622C}.Release|x86.ActiveCfg = Release|Any CPU
{B62C822E-701F-480F-BBB1-0E02217D622C}.Release|x86.Build.0 = Release|Any CPU
{21F2A416-8D25-4EA9-8B49-23030D2E70CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{21F2A416-8D25-4EA9-8B49-23030D2E70CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21F2A416-8D25-4EA9-8B49-23030D2E70CF}.Debug|x64.ActiveCfg = Debug|Any CPU
{21F2A416-8D25-4EA9-8B49-23030D2E70CF}.Debug|x64.Build.0 = Debug|Any CPU
{21F2A416-8D25-4EA9-8B49-23030D2E70CF}.Debug|x86.ActiveCfg = Debug|Any CPU
{21F2A416-8D25-4EA9-8B49-23030D2E70CF}.Debug|x86.Build.0 = Debug|Any CPU
{21F2A416-8D25-4EA9-8B49-23030D2E70CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21F2A416-8D25-4EA9-8B49-23030D2E70CF}.Release|Any CPU.Build.0 = Release|Any CPU
{21F2A416-8D25-4EA9-8B49-23030D2E70CF}.Release|x64.ActiveCfg = Release|Any CPU
{21F2A416-8D25-4EA9-8B49-23030D2E70CF}.Release|x64.Build.0 = Release|Any CPU
{21F2A416-8D25-4EA9-8B49-23030D2E70CF}.Release|x86.ActiveCfg = Release|Any CPU
{21F2A416-8D25-4EA9-8B49-23030D2E70CF}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -235,6 +296,10 @@ Global
{76EF480A-E486-41B7-B7A5-2A849FC8D5BF} = {128ED687-1A48-4DAC-8F08-51CCD0D2FDB2}
{E07528DD-9DEE-47C2-B79D-235ECFA6B003} = {4C86C0FA-C6AF-44BD-A5E7-684B76ABB019}
{47CF6FB0-E37D-4EF1-AFC7-03DB2BCA8892} = {97EF3462-638D-43A2-91F0-A8711C3B2441}
{38B69125-343F-4DDA-AE90-9BF4B21BF875} = {B2591788-4947-4FE8-9BCE-D19402638450}
{6FBD7D1A-C16E-486B-A98C-727C09E514B8} = {B2591788-4947-4FE8-9BCE-D19402638450}
{B62C822E-701F-480F-BBB1-0E02217D622C} = {C8BC2310-EC1F-4740-B0E1-5D1970CB8ABC}
{21F2A416-8D25-4EA9-8B49-23030D2E70CF} = {97EF3462-638D-43A2-91F0-A8711C3B2441}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {707D0154-A468-43A1-B3B7-C21E1B09C409}
......
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
......@@ -5,6 +5,8 @@ using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using VIZ.Framework.Module;
using VIZ.TVP.Golf.Module;
namespace VIZ.TVP.Golf
{
......@@ -13,5 +15,23 @@ namespace VIZ.TVP.Golf
/// </summary>
public partial class App : Application
{
public App()
{
// 初始化 LiteDB
AppSetup.AppendSetup(new AppSetup_InitLiteDB());
// 启动
AppSetupContext context = AppSetup.Setup();
if (context.Exception != null)
{
MessageBox.Show($"执行 {context.ProviderDetail} 失败\r\n{context.Exception.Message}");
}
if (!context.IsSuccess)
{
Environment.Exit(-1);
}
}
}
}
......@@ -4,9 +4,10 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:VIZ.TVP.Golf"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
xmlns:module="clr-namespace:VIZ.TVP.Golf.Module;assembly=VIZ.TVP.Golf.Module"
mc:Ignorable="d" WindowStartupLocation="CenterScreen"
Title="MainWindow" Height="800" Width="1400">
<Grid>
<module:MainView Margin="20"></module:MainView>
</Grid>
</Window>
......@@ -12,6 +12,8 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VIZ.Framework.Connection;
using VIZ.Framework.Module;
namespace VIZ.TVP.Golf
{
......@@ -23,6 +25,21 @@ namespace VIZ.TVP.Golf
public MainWindow()
{
InitializeComponent();
this.Closed -= MainWindow_Closed;
this.Closed += MainWindow_Closed;
}
private void MainWindow_Closed(object sender, EventArgs e)
{
if (!AppSetup.IsSetup)
return;
// 执行卸载流程
AppSetup.UnLoad();
// 执行退出流程
AppSetup.ShutDown();
}
}
}
......@@ -74,6 +74,21 @@
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Xceed.Wpf.AvalonDock, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=4.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>..\packages\Extended.Wpf.Toolkit.4.4.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Extended.Wpf.Toolkit" version="4.4.0" targetFramework="net48" />
<package id="log4net" version="2.0.14" targetFramework="net48" />
</packages>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment