Commit 7192d6c5 authored by 姜春辉's avatar 姜春辉

开发完成

parent b40834a8
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- Backup*.rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<Settings xmlns="urn:Chinags-Configuration" AddonName="GS.Terminal.LogicShell">
</Settings>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<Extensibility xmlns="urn:Chinags-Extensibility-1.0" Name="终端业务界面插件" SymbolicName="GS.Terminal.LogicShell" Version="2.0.1.0" StartLevel="30">
<License>PQypSf3bqcoeawY+ml/JvhDU784Tc+sIPCMDNb/42vS8AoqOxowMaqfLyPjHuJ1XdGb2rZ0YvlwOyKBVlllR1r+8iGq/4HJ7b9QAyoYbmqDF8gixxRk2PrvV9+lY5eepuUtZ3xi09boITUZ31yz6qtVLaei13YFKAnk5Db2YssY=</License>
<Activator Type="GS.Terminal.LogicShell.Activator" />
<Runtime>
<Assembly Path="GS.Terminal.LogicShell.dll" Share="true" />
<Assembly Path="ViewModels/EconomyWeightViewModels.dll" Share="true" />
</Runtime>
<Services>
<Service Caption="试图控制服务" TypeAndName="GS.Terminal.LogicShell.Interface.IViewHelperService"></Service>
</Services>
</Extensibility>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<Settings xmlns="urn:Chinags-Configuration" AddonName="GS.Terminal.MainShell">
<Dictionaries>
<Dict Name="WindowAttribute" Caption="窗体属性">
<Key Caption="窗口头部标题" Name="LogoTitle" Value="" Choice=""/>
<Key Caption="高级设置窗口打开延迟(毫秒)" Name="PasswordWindowDelay" Value="3000" Choice="" />
</Dict>
</Dictionaries>
</Settings>
<?xml version="1.0" encoding="utf-8" ?>
<Extensibility xmlns="urn:Chinags-Extensibility-1.0" Name="主界面" SymbolicName="GS.Terminal.MainShell" Version="2.0.0.0" StartLevel="20">
<License>iLVGuqCCTy+V0cauDJoMTHmmpAGXpbej0ziJivEZX1sq8Qo/WBXJ5WEiWWtxpkkf45wkKUmkNJi8auJi5y5X1VYSP+D15/TROtR85kiQpdZx7IHQXpodt3tjhVnpWNwr9s4TiJrIiQQsV4QKVL+7ysElGccdwgLNOa56vTwyouk=</License>
<Activator Type="GS.Terminal.MainShell.Program" />
<Runtime>
<Assembly Path="GS.Terminal.MainShell.dll" Share="true" />
</Runtime>
<Services>
<Service Caption="跳转服务" TypeAndName="GS.Terminal.MainShell.Services.NavigateService"></Service>
<Service Caption="界面控制服务" TypeAndName="GS.Terminal.MainShell.Services.UIService"></Service>
</Services>
</Extensibility>
\ No newline at end of file
ThemeName=Common
ThemeDescribe=公共资源
<?xml version="1.0" encoding="utf-8" ?>
<Settings xmlns="urn:Chinags-Configuration" AddonName="GS.Terminal.Theme">
<Dictionaries>
<Dict Name="Theme" Caption="默认主题">
<Key Caption="主题名称" Choice="" Name="ThemeName" Value="Default"/>
</Dict>
</Dictionaries>
</Settings>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<Extensibility xmlns="urn:Chinags-Extensibility-1.0" Name="终端皮肤管理插件" SymbolicName="GS.Terminal.Theme" Version="1.0.0.0" StartLevel="10">
<License>
ULuQdHnvhrvUlZmzA5BCjYAK7Qd9kGYtaWzaNyalfGLllQno+WuOpN02bNnqtZBVy0CMsc5vHdGEC2CKn1Oo5d0/h0pezKKRK8pWwWVOkN42Slqjd15Zh/fIcKo6JYLaAWhUs1/NAGXPzLIp5GddHGaEEB9RuicntOi9fUa06YE=
</License>
<Activator Type="GS.Terminal.Theme.AddonActivator"/>
<Runtime>
<Assembly Path="GS.Terminal.Theme.dll" Share="true"/>
</Runtime>
<Services>
<Service Caption="主题管理服务" TypeAndName="GS.Terminal.Theme.Service"></Service>
</Services>
</Extensibility>
\ No newline at end of file
ThemeName=Default
ThemeDescribe=默认
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.props" Condition="Exists('..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.props')" />
<Import Project="..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.props" Condition="Exists('..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.props')" />
<Import Project="..\packages\cef.redist.x86.84.4.1\build\cef.redist.x86.props" Condition="Exists('..\packages\cef.redist.x86.84.4.1\build\cef.redist.x86.props')" />
<Import Project="..\packages\cef.redist.x64.84.4.1\build\cef.redist.x64.props" Condition="Exists('..\packages\cef.redist.x64.84.4.1\build\cef.redist.x64.props')" />
<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>{490D8B88-402C-4D0D-B9CC-A77B049259BF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>EconomyWeightViewModels</RootNamespace>
<AssemblyName>EconomyWeightViewModels</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommonServiceLocator, Version=2.0.2.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..\packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight, Version=5.4.1.0, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.4.1.0, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.4.1.0, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
</Reference>
<Reference Include="GS.Terminal.LogicShell.Interface">
<HintPath>..\..\addons\GS.Terminal.LogicShell\GS.Terminal.LogicShell.Interface.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Locator.cs" />
<Compile Include="MainViewModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\cef.redist.x64.84.4.1\build\cef.redist.x64.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x64.84.4.1\build\cef.redist.x64.props'))" />
<Error Condition="!Exists('..\packages\cef.redist.x86.84.4.1\build\cef.redist.x86.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x86.84.4.1\build\cef.redist.x86.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.targets'))" />
<Error Condition="!Exists('..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.targets'))" />
</Target>
<Import Project="..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.targets" Condition="Exists('..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.targets')" />
<Import Project="..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.targets" Condition="Exists('..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.targets')" />
</Project>
\ No newline at end of file
using CommonServiceLocator;
using GalaSoft.MvvmLight.Ioc;
using GS.Terminal.LogicShell.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EconomyWeightViewModels
{
[Export(typeof(ILocator))]
public class Locator : ILocator
{
public Locator()
{
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
CheckRegistVM<MainViewModel>();
}
private void CheckRegistVM<T>() where T : class
{
if (!SimpleIoc.Default.IsRegistered<T>())
SimpleIoc.Default.Register<T>();
}
public MainViewModel Main
{
get
{
return SimpleIoc.Default.GetInstance<MainViewModel>();
}
}
}
}
using CefSharp;
using CefSharp.Wpf;
using GalaSoft.MvvmLight;
using GS.Terminal.LogicShell.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EconomyWeightViewModels
{
public class MainViewModel : ViewModelBase, IViewModel
{
public string ViewID => "f2173814-0a64-4735-b129-0ab1cadd6e57";
private string _Address;
public string Address
{
get { return _Address; }
set { _Address = value; RaisePropertyChanged("Address"); }
}
public Js JsObject { get; } = new Js();
private IWpfWebBrowser _BrowserInstance;
public IWpfWebBrowser BrowserInstance
{
get { return _BrowserInstance; }
set
{
if (value != null)
{
value.FrameLoadEnd += Value_FrameLoadEnd;
value.JavascriptObjectRepository.ResolveObject += JavascriptObjectRepository_ResolveObject;
}
_BrowserInstance = value;
}
}
private void JavascriptObjectRepository_ResolveObject(object sender, CefSharp.Event.JavascriptBindingEventArgs e)
{
e.ObjectRepository.Register(e.ObjectName, JsObject, false, new BindingOptions() { CamelCaseJavascriptNames = false });
}
public class Js
{
private IJavascriptCallback Callback;
public void RegistDataCallback(CefSharp.IJavascriptCallback s)
{
Callback = s;
}
public async Task Execute(params object[] para)
{
if (Callback != null)
await Callback.ExecuteAsync(para);
}
}
private void Value_FrameLoadEnd(object sender, FrameLoadEndEventArgs e)
{
}
public void Reset()
{
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("EconomyWeightViewModels")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EconomyWeightViewModels")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("490d8b88-402c-4d0d-b9cc-a77b049259bf")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="cef.redist.x64" version="84.4.1" targetFramework="net452" />
<package id="cef.redist.x86" version="84.4.1" targetFramework="net452" />
<package id="CefSharp.Common" version="84.4.10" targetFramework="net452" />
<package id="CefSharp.Wpf" version="84.4.10" targetFramework="net452" />
<package id="CommonServiceLocator" version="2.0.2" targetFramework="net452" />
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net452" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.props" Condition="Exists('..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.props')" />
<Import Project="..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.props" Condition="Exists('..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.props')" />
<Import Project="..\packages\cef.redist.x86.84.4.1\build\cef.redist.x86.props" Condition="Exists('..\packages\cef.redist.x86.84.4.1\build\cef.redist.x86.props')" />
<Import Project="..\packages\cef.redist.x64.84.4.1\build\cef.redist.x64.props" Condition="Exists('..\packages\cef.redist.x64.84.4.1\build\cef.redist.x64.props')" />
<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>{EA606AC0-7B30-40FF-BF13-CB53A7D14B56}</ProjectGuid>
<OutputType>library</OutputType>
<RootNamespace>EconomyWeightViews</RootNamespace>
<AssemblyName>EconomyWeightViews</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="GS.Terminal.LogicShell.Attributes">
<HintPath>..\..\addons\GS.Terminal.LogicShell\GS.Terminal.LogicShell.Attributes.dll</HintPath>
</Reference>
<Reference Include="GS.Terminal.LogicShell.Interface">
<HintPath>..\..\addons\GS.Terminal.LogicShell\GS.Terminal.LogicShell.Interface.dll</HintPath>
</Reference>
<Reference Include="GS.Unitive.Framework.Security, Version=1.4.0.2, Culture=neutral, PublicKeyToken=769358b197600ab3, processorArchitecture=MSIL">
<HintPath>..\packages\GS.Unitive.Framework.Security.1.4.0.2\lib\net40\GS.Unitive.Framework.Security.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Data" />
<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" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.xaml.cs">
<DependentUpon>Main.xaml</DependentUpon>
</Compile>
<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="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Page Include="Main.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\cef.redist.x64.84.4.1\build\cef.redist.x64.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x64.84.4.1\build\cef.redist.x64.props'))" />
<Error Condition="!Exists('..\packages\cef.redist.x86.84.4.1\build\cef.redist.x86.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x86.84.4.1\build\cef.redist.x86.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.targets'))" />
<Error Condition="!Exists('..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.targets'))" />
</Target>
<Import Project="..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.targets" Condition="Exists('..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.targets')" />
<Import Project="..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.targets" Condition="Exists('..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.targets')" />
</Project>
\ No newline at end of file
<Page x:Class="EconomyWeightViews.Main"
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:EconomyWeightViews"
mc:Ignorable="d"
xmlns:cef="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
d:DesignHeight="1080" d:DesignWidth="1920"
Title="Main">
<Grid>
<cef:ChromiumWebBrowser Address="{Binding Address}" WebBrowser="{Binding BrowserInstance,Mode=OneWayToSource}"/>
</Grid>
</Page>
using GS.Terminal.LogicShell.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
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 EconomyWeightViews
{
/// <summary>
/// Main.xaml 的交互逻辑
/// </summary>
[Export(typeof(IView))]
[GS.Unitive.Framework.Security.Core.UnitiveView("首页", "", "f2173814-0a64-4735-b129-0ab1cadd6e57", null)]
public partial class Main : Page, IView
{
public Main()
{
InitializeComponent();
}
public void BindDataContext(IViewModel vm)
{
DataContext = vm;
}
public object Clone()
{
throw new NotImplementedException();
}
public void GoBack()
{
throw new NotImplementedException();
}
public void GoForward()
{
throw new NotImplementedException();
}
public void NavigateToContent(object content)
{
throw new NotImplementedException();
}
public void Reset()
{
throw new NotImplementedException();
}
}
}
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("EconomyWeightViews")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EconomyWeightViews")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[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 EconomyWeightViews.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("EconomyWeightViews.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 EconomyWeightViews.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
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="cef.redist.x64" version="84.4.1" targetFramework="net452" />
<package id="cef.redist.x86" version="84.4.1" targetFramework="net452" />
<package id="CefSharp.Common" version="84.4.10" targetFramework="net452" />
<package id="CefSharp.Wpf" version="84.4.10" targetFramework="net452" />
<package id="GS.Unitive.Framework.Security" version="1.4.0.2" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
</packages>
\ No newline at end of file
<?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>{C14A4866-9D37-44CF-999F-72636851F96D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GS.Terminal.EconomyWeight.LocalDb</RootNamespace>
<AssemblyName>GS.Terminal.EconomyWeight.LocalDb</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="GS.Unitive.Framework.Persistent, Version=1.4.0.2, Culture=neutral, PublicKeyToken=769358b197600ab3, processorArchitecture=MSIL">
<HintPath>..\packages\GS.Unitive.Framework.Persistent.1.4.0.2\lib\net40\GS.Unitive.Framework.Persistent.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="WeightData.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("GS.Terminal.EconomyWeight.LocalDb")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GS.Terminal.EconomyWeight.LocalDb")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("c14a4866-9d37-44cf-999f-72636851f96d")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using GS.Unitive.Framework.Data.Xpo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.EconomyWeight.LocalDb
{
public class WeightData : UnitiveObject
{
public WeightData(Session session) : base(session)
{
}
private int _Id;
[Key(true)]
public int Id
{
get { return _Id; }
set { SetPropertyValue("Id", ref _Id, value); }
}
private double _Data;
public double Data
{
get { return _Data; }
set { SetPropertyValue("Data", ref _Data, value); }
}
private DateTime _Time;
public DateTime Time
{
get { return _Time; }
set { SetPropertyValue("Time", ref _Time, value); }
}
private bool _Upload;
public bool Upload
{
get { return _Upload; }
set { SetPropertyValue("Upload", ref _Upload, value); }
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="GS.Unitive.Framework.Persistent" version="1.4.0.2" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<Settings xmlns="urn:Chinags-Configuration" AddonName="GS.Terminal.EconomyWeight.Logic">
<Dictionaries>
<Dict Name="DeviceConfig" Caption="设备配置">
<Key Caption="串口号" Choice="" Name="COMPort" Value="1"/>
<Key Caption="取样间隔(毫秒)" Choice="" Name="SampleInterval" Value="50"/>
</Dict>
<Dict Name="LogicConfig" Caption="业务配置">
<Key Caption="数据保存间隔(秒)" Choice="" Name="SaveDataInterval" Value="3"/>
<Key Caption="上传间隔(秒)" Choice="" Name="UploadDataInterval" Value="10"/>
<Key Caption="重试上传间隔(秒)" Choice="" Name="RetryUploadDataInterval" Value="30"/>
<Key Caption="数据展示页面远程地址" Choice="" Name="WebUrl" Value="http://localhost:8001/"/>
</Dict>
</Dictionaries>
<Structures>
<Structure Caption="服务地址配置" Name="ServiceList">
<Declare>
<Property Caption="服务描述" Name="Description"/>
<Property Caption="名称(不可随意修改)" Name="Key"/>
<Property Caption="服务地址" Name="ServiceUri"/>
</Declare>
<Datas>
<Data Description="上传称重记录" Key="UploadData" ServiceUri="/Integrats/GS.Sub.CampusExtension.Hz2z/SaveWeighingInfo" />
</Datas>
</Structure>
</Structures>
</Settings>
\ No newline at end of file
using GS.Terminal.Common.WebService;
using GS.Terminal.EconomyWeight.LocalDb;
using GS.Terminal.EconomyWeight.Logic.Remote;
using GS.Unitive.Framework.Data.Linq;
using GS.Unitive.Framework.Data.Xpo;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace GS.Terminal.EconomyWeight.Logic
{
public class DataCenter : IDisposable
{
private int _saveInterval;
private static object _DBLocker = new object();
private DateTime _lastTime = DateTime.Now;
private string _uploadUrl = "";
private ConcurrentQueue<CacheData> saveQueue = new ConcurrentQueue<CacheData>();
private Task _uploadTask = null;
private CancellationTokenSource _CTS = new CancellationTokenSource();
private Task _retryTask = null;
private CancellationTokenSource _RetryCTS = new CancellationTokenSource();
public DataCenter()
{
_saveInterval = LocalSetting.LogicConfig.SaveDataInterval;
if (_saveInterval <= 0)
_saveInterval = 5;
_uploadUrl = LocalSetting.ServiceList.GetSerivceUri("UploadData");
if (string.IsNullOrEmpty(_uploadUrl)) throw new Exception("请设置UploadData服务地址");
_uploadTask = Task.Factory.StartNew(async () =>
{
while (!_CTS.IsCancellationRequested)
{
try
{
var wait = new List<CacheData>();
while (saveQueue.TryDequeue(out CacheData result))
{
wait.Add(result);
}
if (wait.Count == 0) continue;
//本地保存
var saved = new List<WeightData>();
lock (_DBLocker)
{
var session = Program._ObjectSpace.Session;
foreach (var item in wait)
{
var db = new WeightData(session)
{
Data = item.Data,
Time = item.Time
};
db.Save();
saved.Add(db);
}
}
//上传数据
var uploadResult = await Upload(saved);
if (uploadResult)
{
lock (_DBLocker)
saved.ForEach(item =>
{
item.Upload = true;
item.Save();
});
}
}
catch (Exception ex)
{
Program._Context.Logger.Error($"保存&上传数据异常", ex);
}
finally
{
await Task.Delay(LocalSetting.LogicConfig.UploadDataInterval * 1000);
}
}
}, _CTS.Token);
_retryTask = Task.Factory.StartNew(async () =>
{
while (!_RetryCTS.IsCancellationRequested)
{
try
{
List<WeightData> datas = new List<WeightData>();
lock (_DBLocker)
{
var session = Program._ObjectSpace.Session;
var query = session.Query<WeightData>()
.Where(ss => !ss.Upload && ss.Time >= DateTime.Now.AddDays(-3).Date);
datas = query.ToList();
}
if (datas.Count > 0)
{
var uploadResult = await Upload(datas);
if (uploadResult)
lock (_DBLocker)
datas.ForEach(item =>
{
item.Upload = true;
item.Save();
});
}
}
catch (Exception ex)
{
Program._Context.Logger.Error($"重新上传数据异常", ex);
}
finally
{
await Task.Delay(LocalSetting.LogicConfig.RetryUploadDataInterval * 1000);
}
}
}, _RetryCTS.Token);
}
private async Task<bool> Upload(List<WeightData> datas)
{
var uploadResult = await WebApi.PostAsync<WebServiceResult<ServiceResponse>>(_uploadUrl, new
{
tCode = LocalSetting.AppConfig.tCode,
weighingInfo = datas.Select(ss => new
{
weight = ss.Data,
time = ss.Time
}).ToList()
});
return uploadResult != null && uploadResult.result != null && uploadResult.result.success;
}
public void Dispose()
{
_CTS.Cancel();
while (_uploadTask.Status == TaskStatus.Running)
Task.Delay(100).Wait();
}
public void PushData(double data)
{
var now = DateTime.Now;
if ((now - _lastTime).TotalSeconds < _saveInterval) return;
saveQueue.Enqueue(new CacheData { Data = data, Time = now });
//var session = Program._ObjectSpace.Session;
//var dataItem = new WeightData(session)
//{
// Data = data,
// Time = now
//};
//dataItem.Save();
_lastTime = now;
}
}
public class CacheData
{
public double Data { get; set; }
public DateTime Time { get; set; }
}
public class ServiceResponse
{
public bool success { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.EconomyWeight.Logic
{
public class Device
{
SerialPort serialPort;
public Device(int port)
{
Port = $"COM{port}";
serialPort = new SerialPort(Port);
}
public string Port { get; private set; }
public void Open()
{
serialPort.Open();
}
public double Read()
{
serialPort.Write("R");
var data = serialPort.ReadLine().TrimEnd("\r".ToArray());
return convert(data);
}
private double convert(string d)
{
var convertData = d.Remove(0, 2).TrimEnd("kg".ToArray()).TrimEnd('b');
if (double.TryParse(convertData, out double result))
return result;
return 0;
}
public void Close()
{
serialPort.Close();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.props" Condition="Exists('..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.props')" />
<Import Project="..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.props" Condition="Exists('..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.props')" />
<Import Project="..\packages\cef.redist.x86.84.4.1\build\cef.redist.x86.props" Condition="Exists('..\packages\cef.redist.x86.84.4.1\build\cef.redist.x86.props')" />
<Import Project="..\packages\cef.redist.x64.84.4.1\build\cef.redist.x64.props" Condition="Exists('..\packages\cef.redist.x64.84.4.1\build\cef.redist.x64.props')" />
<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>{C8AA975D-350A-4FCF-89D9-A1FB3B44B5A5}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GS.Terminal.EconomyWeight.Logic</RootNamespace>
<AssemblyName>GS.Terminal.EconomyWeight.Logic</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommonServiceLocator, Version=2.0.2.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..\packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight, Version=5.4.1.0, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.4.1.0, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.4.1.0, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
</Reference>
<Reference Include="GS.Terminal.Common">
<HintPath>..\..\tools\GS.Terminal.Common.dll</HintPath>
</Reference>
<Reference Include="GS.Terminal.LogicShell.Interface">
<HintPath>..\..\addons\GS.Terminal.LogicShell\GS.Terminal.LogicShell.Interface.dll</HintPath>
</Reference>
<Reference Include="GS.Unitive.Framework, Version=1.4.0.2, Culture=neutral, PublicKeyToken=769358b197600ab3, processorArchitecture=MSIL">
<HintPath>..\packages\GS.Unitive.Framework.1.4.0.2\lib\net40\GS.Unitive.Framework.dll</HintPath>
</Reference>
<Reference Include="GS.Unitive.Framework.Persistent, Version=1.4.0.2, Culture=neutral, PublicKeyToken=769358b197600ab3, processorArchitecture=MSIL">
<HintPath>..\packages\GS.Unitive.Framework.Persistent.1.4.0.2\lib\net40\GS.Unitive.Framework.Persistent.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="SafeObjectPool, Version=2.3.1.0, Culture=neutral, PublicKeyToken=2979badd66b9f481, processorArchitecture=MSIL">
<HintPath>..\packages\SafeObjectPool.2.3.1\lib\net45\SafeObjectPool.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DataCenter.cs" />
<Compile Include="Device.cs" />
<Compile Include="LocalSetting.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Remote\WebApi.cs" />
<Compile Include="ThirdAddon\LogicShell.cs" />
<Compile Include="ThirdAddon\MainShell.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Config.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Mapper.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EconomyWeightViewModels\EconomyWeightViewModels.csproj">
<Project>{490D8B88-402C-4D0D-B9CC-A77B049259BF}</Project>
<Name>EconomyWeightViewModels</Name>
</ProjectReference>
<ProjectReference Include="..\GS.Terminal.EconomyWeight.LocalDb\GS.Terminal.EconomyWeight.LocalDb.csproj">
<Project>{c14a4866-9d37-44cf-999f-72636851f96d}</Project>
<Name>GS.Terminal.EconomyWeight.LocalDb</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\cef.redist.x64.84.4.1\build\cef.redist.x64.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x64.84.4.1\build\cef.redist.x64.props'))" />
<Error Condition="!Exists('..\packages\cef.redist.x86.84.4.1\build\cef.redist.x86.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x86.84.4.1\build\cef.redist.x86.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.targets'))" />
<Error Condition="!Exists('..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.targets'))" />
</Target>
<Import Project="..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.targets" Condition="Exists('..\packages\CefSharp.Common.84.4.10\build\CefSharp.Common.targets')" />
<Import Project="..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.targets" Condition="Exists('..\packages\CefSharp.Wpf.84.4.10\build\CefSharp.Wpf.targets')" />
</Project>
\ No newline at end of file
using GS.Terminal.Common.LocalSetting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.EconomyWeight.Logic
{
public static class LocalSetting
{
static LocalSetting()
{
DeviceConfig = LocalSettingLoader.Load<DeviceConfig>(Program._Context);
LogicConfig = LocalSettingLoader.Load<LogicConfig>(Program._Context);
AppConfig = LocalSettingLoader.Load<AppConfig>(Program._Context);
ServiceList = LocalSettingLoader.Load<ServiceList>(Program._Context);
}
public static DeviceConfig DeviceConfig { get; }
public static LogicConfig LogicConfig { get; }
public static AppConfig AppConfig { get; }
public static ServiceList ServiceList { get; }
}
public class DeviceConfig : IDictSetting
{
public int COMPort { get; set; }
public int SampleInterval { get; set; }
public string DictName => "DeviceConfig";
}
public class LogicConfig : IDictSetting
{
public string WebUrl { get; set; }
public int SaveDataInterval { get; set; }
public int UploadDataInterval { get; set; }
public int RetryUploadDataInterval { get; set; }
public string DictName => "LogicConfig";
}
public class AppConfig : IGlobalSetting
{
public string WebPath { get; set; }
public string ServerIP { get; set; }
public string tCode { get; set; }
}
public class ServiceList : IStructureSetting<ServiceListItem>
{
public List<ServiceListItem> Datas { get; set; } = new List<ServiceListItem>();
public string StructureName => "ServiceList";
public string GetSerivceUri(string key)
{
var find = Datas.FirstOrDefault(ss => ss.Key == key);
if (find != null)
return find.ServiceUri;
return "";
}
}
public class ServiceListItem : IStructureSettingItem
{
public string Description { get; set; }
public string Key { get; set; }
public string ServiceUri { get; set; }
}
}
<?xml version="1.0" encoding="utf-8" ?>
<Extensibility xmlns="urn:Chinags-Extensibility-1.0" Name="终端皮肤管理插件" SymbolicName="GS.Terminal.EconomyWeight.Logic" Version="1.0.0.0" StartLevel="999">
<License>
lZFFCdNY6W5fc/0SpW0+so06kFiLXbpBi5jcgVZ2PPSkJoyUrxzSC7HE4bTXd18Yidp5NmtmT0qAQpeMuyG/uW5CEWnL7ypR1wDhDDOxjKAnrkXAKeCQoPlX+E9ENs/6lHjdwqyOpwk5YpWbD1pfddaXpltNdrxupIYZrcXcjNE=
</License>
<Activator Type="GS.Terminal.EconomyWeight.Logic.Program"/>
<Runtime>
<Assembly Path="GS.Terminal.EconomyWeight.Logic.dll" Share="true"/>
<Assembly Path="GS.Terminal.EconomyWeight.LocalDb.dll" Share="true"/>
</Runtime>
<ObjectSpaces>
<Channel ConnectionName="sqlite" ModelAssembly="GS.Terminal.EconomyWeight.LocalDb" Name="sqlite"/>
</ObjectSpaces>
<Services>
</Services>
</Extensibility>
\ No newline at end of file
using EconomyWeightViewModels;
using GS.Unitive.Framework.Core;
using GS.Unitive.Framework.Persistent;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.EconomyWeight.Logic
{
public class Program : IAddonActivator
{
internal static IAddonContext _Context;
private static ObjectSpaceManager manager;
internal static IObjectSpace _ObjectSpace
{
get
{
return manager.CreateObjectSpace(_Context, "sqlite");
}
}
internal static Locator vmLocator;
internal static Device MainDevice;
internal static DataCenter DataCenter;
internal static string _logicVersion = "0910";
public void Start(IAddonContext Context)
{
_Context = Context;
vmLocator = new Locator();
MainDevice = new Device(LocalSetting.DeviceConfig.COMPort);
if (LocalSetting.LogicConfig.WebUrl.Contains("?"))
{
vmLocator.Main.Address = $"{LocalSetting.LogicConfig.WebUrl}&tCode={LocalSetting.AppConfig.tCode}";
}
else
{
vmLocator.Main.Address = $"{LocalSetting.LogicConfig.WebUrl}?tCode={LocalSetting.AppConfig.tCode}";
}
AddonRuntime.Instance.onRuntimeCompleted += Instance_onRuntimeCompleted;
}
private void Instance_onRuntimeCompleted(object sender)
{
manager = new ObjectSpaceManager();
_ObjectSpace.UpdateDataSchema();
ThirdAddon.LogicShell.ShowView(vmLocator.Main);
MainDevice.Open();
DataCenter = new DataCenter();
Task.Factory.StartNew(async () =>
{
while (true)
{
try
{
var data = MainDevice.Read();
DataCenter.PushData(data);
var dataStr = data.ToString("f2").PadLeft(7, '0');
await vmLocator.Main.JsObject.Execute(dataStr);
await Task.Delay(LocalSetting.DeviceConfig.SampleInterval);
}
catch (Exception ex)
{
_Context.Logger.Error($"读取数值异常", ex);
}
}
});
}
public void Stop(IAddonContext Context)
{
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("GS.Terminal.EconomyWeight.Logic")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GS.Terminal.EconomyWeight.Logic")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("c8aa975d-350a-4fcf-89d9-a1fb3b44b5a5")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.EconomyWeight.Logic.Remote
{
public static class WebApi
{
private static SafeObjectPool.ObjectPool<HttpClient> _httpclientPool = null;
static WebApi()
{
_httpclientPool = new SafeObjectPool.ObjectPool<HttpClient>(10, () =>
{
var _client = new HttpClient();
_client.BaseAddress = new Uri(LocalSetting.AppConfig.WebPath);
_client.Timeout = TimeSpan.FromSeconds(30);
_client.DefaultRequestHeaders.UserAgent.Add(new System.Net.Http.Headers.ProductInfoHeaderValue("GS.Terminal.VisitorSelfService", Program._logicVersion));
return _client;
});
}
public static async Task<T> GetTAsync<T>(string service)
{
var _clientPoolObject = await _httpclientPool.GetAsync();
var _client = _clientPoolObject.Value;
try
{
var result = await _client.GetAsync(service);
if (result.IsSuccessStatusCode)
{
var responseBody = await result.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<T>(responseBody);
}
else
{
Program._Context.Logger.Error($"请求服务[{service}]异常,StatusCode:{result.StatusCode}", null);
}
}
catch (Exception ex)
{
Program._Context.Logger.Error($"Get请求{service}服务异常.", ex);
if (ex.InnerException != null)
Program._Context.Logger.Error($"Get请求{service}服务异常.InnerException", ex.InnerException);
}
finally
{
_httpclientPool.Return(_clientPoolObject);
}
return default(T);
}
public static async Task<T> PostAsync<T>(string service, object requestBody)
{
var bodyString = JsonConvert.SerializeObject(requestBody);
var content = new StringContent(bodyString);
content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
var _clientPoolObject = await _httpclientPool.GetAsync();
var _client = _clientPoolObject.Value;
try
{
var result = await _client.PostAsync(service, content);
if (result.IsSuccessStatusCode)
{
var responseBody = await result.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<T>(responseBody);
}
else
{
Program._Context.Logger.Error($"请求服务[{service}]异常,StatusCode:{result.StatusCode}", null);
}
}
catch (Exception ex)
{
Program._Context.Logger.Error($"Post请求{service}服务异常.", ex);
if (ex.InnerException != null)
Program._Context.Logger.Error($"Post请求{service}服务异常.InnerException", ex.InnerException);
}
finally
{
_httpclientPool.Return(_clientPoolObject);
}
return default(T);
}
public static T Post<T>(string service, object requestBody)
{
var bodyString = JsonConvert.SerializeObject(requestBody);
var content = new StringContent(bodyString);
var _clientPoolObject = _httpclientPool.Get();
var _client = _clientPoolObject.Value;
try
{
var result = _client.PostAsync(service, content).Result;
if (result.IsSuccessStatusCode)
{
var responseBody = result.Content.ReadAsStringAsync().Result;
return JsonConvert.DeserializeObject<T>(responseBody);
}
}
catch (Exception ex)
{
Program._Context.Logger.Error($"Post请求{service}服务异常.", ex);
if (ex.InnerException != null)
Program._Context.Logger.Error($"Post请求{service}服务异常.InnerException", ex.InnerException);
}
finally
{
_httpclientPool.Return(_clientPoolObject);
}
return default(T);
}
}
}
using GS.Terminal.LogicShell.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.EconomyWeight.Logic.ThirdAddon
{
public static class LogicShell
{
private static IViewHelperService _service;
static LogicShell()
{
_service = Program._Context.GetFirstOrDefaultService<IViewHelperService>("GS.Terminal.LogicShell");
if (_service == null)
{
Program._Context.Logger.Error($"GS.Terminal.LogicShell插件服务IViewHelperService未找到", null);
}
}
internal static void ShowView(IViewModel v)
{
_service.ShowView(v);
}
internal static IPopWindowHandler Open(IViewModel v)
{
return _service.Open(v);
}
internal static IPopWindowHandler Close(IViewModel v)
{
return _service.Close(v);
}
internal static IView GetViewByID(string id)
{
return _service.GetViewByID(id);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Input;
namespace GS.Terminal.EconomyWeight.Logic.ThirdAddon
{
public static class MainShell
{
private static dynamic _UIService;
static MainShell()
{
_UIService = Program._Context.GetFirstOrDefaultService("GS.Terminal.MainShell", "GS.Terminal.MainShell.Services.UIService");
if (_UIService == null)
{
Program._Context.Logger.Error($"GS.Terminal.LogicShell插件服务IViewHelperService未找到", null);
}
}
/// <summary>
/// 注册高级窗口命令
/// </summary>
/// <param name="command"></param>
/// <param name="cb"></param>
public static void RegistBackgroundCommand(string command, Action cb)
{
_UIService?.RegistBackgroundCommand(command, cb);
}
/// <summary>
/// 显示提示
/// </summary>
/// <param name="msg"></param>
public static void ShowPrompt(string msg)
{
_UIService?.ShowPrompt(msg);
}
public static void ShowLoading(string title = "请稍后...")
{
_UIService?.ShowLoading(title);
}
public static void HideLoading()
{
_UIService?.HideLoading();
}
public static string AddGarnitureControl(UserControl uc, double top, double left)
{
return _UIService.AddGarnitureControl(uc, top, left);
}
internal static void AddWindowKeyUp(Action<KeyEventArgs> action)
{
_UIService?.AddWindowKeyUp(action);
}
internal static void RemoveWindowKeyUp(Action<KeyEventArgs> action)
{
_UIService?.RemoveWindowKeyUp(action);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="cef.redist.x64" version="84.4.1" targetFramework="net452" />
<package id="cef.redist.x86" version="84.4.1" targetFramework="net452" />
<package id="CefSharp.Common" version="84.4.10" targetFramework="net452" />
<package id="CefSharp.Wpf" version="84.4.10" targetFramework="net452" />
<package id="CommonServiceLocator" version="2.0.2" targetFramework="net452" />
<package id="GS.Unitive.Framework" version="1.4.0.2" targetFramework="net452" />
<package id="GS.Unitive.Framework.Persistent" version="1.4.0.2" targetFramework="net452" />
<package id="log4net" version="2.0.8" targetFramework="net452" />
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
<package id="SafeObjectPool" version="2.3.1" targetFramework="net452" />
</packages>
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30104.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GS.Terminal.EconomyWeightHost", "GS.Terminal.EconomyWeightHost\GS.Terminal.EconomyWeightHost.csproj", "{C950CB68-EE59-4280-A45E-AE523B3705A2}"
ProjectSection(ProjectDependencies) = postProject
{C8AA975D-350A-4FCF-89D9-A1FB3B44B5A5} = {C8AA975D-350A-4FCF-89D9-A1FB3B44B5A5}
{EA606AC0-7B30-40FF-BF13-CB53A7D14B56} = {EA606AC0-7B30-40FF-BF13-CB53A7D14B56}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GS.Terminal.EconomyWeight.Logic", "GS.Terminal.EconomyWeight.Logic\GS.Terminal.EconomyWeight.Logic.csproj", "{C8AA975D-350A-4FCF-89D9-A1FB3B44B5A5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EconomyWeightViewModels", "EconomyWeightViewModels\EconomyWeightViewModels.csproj", "{490D8B88-402C-4D0D-B9CC-A77B049259BF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EconomyWeightViews", "EconomyWeightViews\EconomyWeightViews.csproj", "{EA606AC0-7B30-40FF-BF13-CB53A7D14B56}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GS.Terminal.EconomyWeight.LocalDb", "GS.Terminal.EconomyWeight.LocalDb\GS.Terminal.EconomyWeight.LocalDb.csproj", "{C14A4866-9D37-44CF-999F-72636851F96D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C950CB68-EE59-4280-A45E-AE523B3705A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C950CB68-EE59-4280-A45E-AE523B3705A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C950CB68-EE59-4280-A45E-AE523B3705A2}.Debug|x64.ActiveCfg = Debug|x64
{C950CB68-EE59-4280-A45E-AE523B3705A2}.Debug|x64.Build.0 = Debug|x64
{C950CB68-EE59-4280-A45E-AE523B3705A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C950CB68-EE59-4280-A45E-AE523B3705A2}.Release|Any CPU.Build.0 = Release|Any CPU
{C950CB68-EE59-4280-A45E-AE523B3705A2}.Release|x64.ActiveCfg = Release|Any CPU
{C950CB68-EE59-4280-A45E-AE523B3705A2}.Release|x64.Build.0 = Release|Any CPU
{C8AA975D-350A-4FCF-89D9-A1FB3B44B5A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C8AA975D-350A-4FCF-89D9-A1FB3B44B5A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C8AA975D-350A-4FCF-89D9-A1FB3B44B5A5}.Debug|x64.ActiveCfg = Debug|x64
{C8AA975D-350A-4FCF-89D9-A1FB3B44B5A5}.Debug|x64.Build.0 = Debug|x64
{C8AA975D-350A-4FCF-89D9-A1FB3B44B5A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C8AA975D-350A-4FCF-89D9-A1FB3B44B5A5}.Release|Any CPU.Build.0 = Release|Any CPU
{C8AA975D-350A-4FCF-89D9-A1FB3B44B5A5}.Release|x64.ActiveCfg = Release|Any CPU
{C8AA975D-350A-4FCF-89D9-A1FB3B44B5A5}.Release|x64.Build.0 = Release|Any CPU
{490D8B88-402C-4D0D-B9CC-A77B049259BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{490D8B88-402C-4D0D-B9CC-A77B049259BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{490D8B88-402C-4D0D-B9CC-A77B049259BF}.Debug|x64.ActiveCfg = Debug|x64
{490D8B88-402C-4D0D-B9CC-A77B049259BF}.Debug|x64.Build.0 = Debug|x64
{490D8B88-402C-4D0D-B9CC-A77B049259BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{490D8B88-402C-4D0D-B9CC-A77B049259BF}.Release|Any CPU.Build.0 = Release|Any CPU
{490D8B88-402C-4D0D-B9CC-A77B049259BF}.Release|x64.ActiveCfg = Release|Any CPU
{490D8B88-402C-4D0D-B9CC-A77B049259BF}.Release|x64.Build.0 = Release|Any CPU
{EA606AC0-7B30-40FF-BF13-CB53A7D14B56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EA606AC0-7B30-40FF-BF13-CB53A7D14B56}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA606AC0-7B30-40FF-BF13-CB53A7D14B56}.Debug|x64.ActiveCfg = Debug|x64
{EA606AC0-7B30-40FF-BF13-CB53A7D14B56}.Debug|x64.Build.0 = Debug|x64
{EA606AC0-7B30-40FF-BF13-CB53A7D14B56}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA606AC0-7B30-40FF-BF13-CB53A7D14B56}.Release|Any CPU.Build.0 = Release|Any CPU
{EA606AC0-7B30-40FF-BF13-CB53A7D14B56}.Release|x64.ActiveCfg = Release|Any CPU
{EA606AC0-7B30-40FF-BF13-CB53A7D14B56}.Release|x64.Build.0 = Release|Any CPU
{C14A4866-9D37-44CF-999F-72636851F96D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C14A4866-9D37-44CF-999F-72636851F96D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C14A4866-9D37-44CF-999F-72636851F96D}.Debug|x64.ActiveCfg = Debug|x64
{C14A4866-9D37-44CF-999F-72636851F96D}.Debug|x64.Build.0 = Debug|x64
{C14A4866-9D37-44CF-999F-72636851F96D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C14A4866-9D37-44CF-999F-72636851F96D}.Release|Any CPU.Build.0 = Release|Any CPU
{C14A4866-9D37-44CF-999F-72636851F96D}.Release|x64.ActiveCfg = Release|Any CPU
{C14A4866-9D37-44CF-999F-72636851F96D}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {74B01F3A-0886-4A34-BA93-7D369263DD3E}
EndGlobalSection
EndGlobal
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--整屏背景图片-->
<Style x:Key="MainShell_BodyBackground" TargetType="Grid">
<Setter Property="Background" Value="Transparent"/>
</Style>
<!-- 顶部背景颜色-->
<Style x:Key="MainShell_HeaderBackground" TargetType="Grid">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
<!-- 底部背景颜色-->
<Style x:Key="MainShell_FootBackground" TargetType="Grid">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
<Style x:Key="MainShell_FullBackground" TargetType="Grid">
</Style>
<!-- LOGO图片-->
<Style x:Key="MainShell_LogoImage" TargetType="Image">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
<!-- 系统名称-->
<Style x:Key="MainShell_LogoText" TargetType="TextBlock">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
<Style x:Key="MainShell_HeadLeft" TargetType="Grid">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
<Style x:Key="MainShell_HeadRight" TargetType="Grid">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</ResourceDictionary>
\ No newline at end of file
ThemeName=Common
ThemeDescribe=公共资源
MainShellWindowStyle.xaml
ThemeName=Default
ThemeDescribe=默认
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<appSettings>
<add key="tCode" value="Hz2zWeight0"/>
<add key="WebPath" value="http://192.168.1.7:9090/"/>
</appSettings>
</configuration>
\ No newline at end of file
<Application x:Class="GS.Terminal.EconomyWeightHost.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GS.Terminal.EconomyWeightHost">
<Application.Resources>
</Application.Resources>
</Application>
using CefSharp;
using GalaSoft.MvvmLight.Threading;
using GS.Unitive.Framework.Core;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace GS.Terminal.EconomyWeightHost
{
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public partial class App : Application
{
public App()
{
DispatcherHelper.Initialize();
}
protected override void OnStartup(StartupEventArgs e)
{
CefSharpSettings.WcfEnabled = true;
Current.ShutdownMode = ShutdownMode.OnExplicitShutdown;
AddonRuntime addonRuntime = new AddonRuntime();
addonRuntime.Start();
Window mainWindow = AddonRuntime.Instance.GetFirstDefaultHostMain<Window>();
mainWindow?.Show();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<DataSpaces xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Encrypt="false" xmlns="urn:Chinags-DataSpaceConfig">
<Connection Name="sqlite" DBType="SQLITE" Database="economyweight.db" User="" Password="123" />
</DataSpaces>
\ No newline at end of file
<Window x:Class="GS.Terminal.EconomyWeightHost.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:GS.Terminal.EconomyWeightHost"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
</Grid>
</Window>
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 GS.Terminal.EconomyWeightHost
{
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("GS.Terminal.EconomyWeightHost")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GS.Terminal.EconomyWeightHost")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[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 GS.Terminal.EconomyWeightHost.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("GS.Terminal.EconomyWeightHost.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 GS.Terminal.EconomyWeightHost.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
<log4net>
<!-- 调试日志类-->
<logger name="logdebug">
<level value="OFF" />
<appender-ref ref="DebugAppender" />
</logger>
<!-- 错误日志类-->
<logger name="logerror">
<level value="ALL" />
<appender-ref ref="ErrorAppender" />
</logger>
<!-- 信息日志类 -->
<logger name="loginfo">
<level value="ALL" />
<appender-ref ref="InfoAppender" />
</logger>
<!-- 调试日志附加介质-->
<appender name="DebugAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\\LogDebug\\" />
<param name="AppendToFile" value="false" />
<param name="MaxFileSize" value="1024" />
<param name="MaxSizeRollBackups" value="3" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value="yyyyMMdd&quot;.htm&quot;" />
<param name="RollingStyle" value="Date" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<Encoding value="UTF-8" />
<!-- 信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;HR COLOR=blue&gt;%n日志时间:%d [%t] &lt;BR&gt;%n日志级别:%-5p &lt;BR&gt;%n日 志 类:%c &lt;BR&gt;%n%m &lt;BR&gt;%n &lt;HR Size=1&gt;" />
</layout>
</appender>
<!-- 错误日志附加介质-->
<appender name="ErrorAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\\LogError\\" />
<param name="AppendToFile" value="false" />
<param name="MaxSizeRollBackups" value="5" />
<param name="MaxFileSize" value="1024" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value="yyyyMMdd&quot;.htm&quot;" />
<param name="RollingStyle" value="Date" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<Encoding value="UTF-8" />
<!--布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;HR COLOR=red&gt;%n【异常时间】:%d [%t] &lt;BR&gt;%n【异常级别】:%-5p &lt;BR&gt;%n【异 常 类】:%c &lt;BR&gt;%n%m &lt;BR&gt;%n &lt;HR Size=1&gt;" />
</layout>
</appender>
<!-- 信息日志附加介质-->
<appender name="InfoAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="Log\\LogInfo\\" />
<param name="AppendToFile" value="false" />
<param name="MaxFileSize" value="1024" />
<param name="MaxSizeRollBackups" value="3" />
<param name="StaticLogFileName" value="false" />
<param name="DatePattern" value="&quot;Info&quot;yyyyMMdd&quot;.htm&quot;" />
<param name="RollingStyle" value="Date" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<Encoding value="UTF-8" />
<!-- 信息日志布局-->
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="&lt;HR COLOR=blue&gt;%n日志时间:%d [%t] &lt;BR&gt;%n日志级别:%-5p &lt;BR&gt;%n日 志 类:%c &lt;BR&gt;%n%m &lt;BR&gt;%n &lt;HR Size=1&gt;" />
</layout>
</appender>
</log4net>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="cef.redist.x64" version="84.4.1" targetFramework="net452" />
<package id="cef.redist.x86" version="84.4.1" targetFramework="net452" />
<package id="CefSharp.Common" version="84.4.10" targetFramework="net452" />
<package id="CefSharp.Wpf" version="84.4.10" targetFramework="net452" />
<package id="CommonServiceLocator" version="2.0.2" targetFramework="net452" />
<package id="GS.Unitive.Framework" version="1.4.0.2" targetFramework="net452" />
<package id="GS.Unitive.Framework.Persistent" version="1.4.0.2" targetFramework="net452" />
<package id="GS.Unitive.Framework.Security" version="1.4.0.2" targetFramework="net452" />
<package id="log4net" version="2.0.8" targetFramework="net452" />
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
<package id="System.Data.SQLite.Core" version="1.0.112.0" targetFramework="net452" />
</packages>
\ No newline at end of file
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