Commit ff203f1c by liulongfei

项目初始化

parent fbabac93
###############################################################################
# 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
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/
# 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
nunit-*.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/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# 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
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# 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
# NuGet Symbol Packages
*.snupkg
# 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
*.appxbundle
*.appxupload
# 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
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).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/
# 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
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
\ No newline at end of file
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("VIZ.Package.Common")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VIZ.Package.Common")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
//若要开始生成可本地化的应用程序,请设置
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
//例如,如果您在源文件中使用的是美国英语,
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
//对以下 NeutralResourceLanguage 特性的注释。 更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(未在页面中找到资源时使用,
//或应用程序资源字典中找到时使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(未在页面中找到资源时使用,
//、应用程序或任何主题专用资源字典中找到时使用)
)]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace VIZ.Package.Common.Properties {
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if ((resourceMan == null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VIZ.Package.Common.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VIZ.Package.Common.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
\ No newline at end of file
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:VIZ.Package.Common">
</ResourceDictionary>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E4912BCE-BC90-4457-9EE3-06435496D979}</ProjectGuid>
<OutputType>library</OutputType>
<RootNamespace>VIZ.Package.Common</RootNamespace>
<AssemblyName>VIZ.Package.Common</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<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>
</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>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.14" targetFramework="net48" />
</packages>
\ No newline at end of file
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("VIZ.Package.Connection")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VIZ.Package.Connection")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("421527f6-37b8-4615-9317-ffd5e272181b")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Connection
{
/// <summary>
/// 包装终结点管理器
/// </summary>
public interface ITVPEndpointManager : IDisposable
{
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Connection;
namespace VIZ.Package.Connection
{
/// <summary>
/// Viz连接
/// </summary>
public class VizConnection
{
/// <summary>
/// 终结点管理器集合
/// </summary>
private Dictionary<string, VizEndpointManager> endpointManagers = new Dictionary<string, VizEndpointManager>();
/// <summary>
/// 获取VIZ终结点管理器
/// </summary>
/// <param name="key">终结点管理器键</param>
/// <returns>终结点管理器</returns>
public VizEndpointManager GetEndpointManager(string key)
{
this.endpointManagers.TryGetValue(key, out VizEndpointManager manager);
return manager;
}
/// <summary>
/// 添加VIZ终结点管理器
/// </summary>
/// <param name="manager">终结点管理器</param>
public void AddEndpointManager(VizEndpointManager manager)
{
manager.VizConnection = this;
lock (this.endpointManagers)
{
this.endpointManagers.Add(manager.Key, manager);
}
}
/// <summary>
/// 移除UDP终结点管理器
/// </summary>
/// <param name="key">终结点管理器键</param>
public void RemoveEndpointManager(string key)
{
lock (this.endpointManagers)
{
if (this.endpointManagers.ContainsKey(key))
{
this.endpointManagers.Remove(key);
}
}
}
/// <summary>
/// 销毁
/// </summary>
public void Dispose()
{
lock (this.endpointManagers)
{
foreach (VizEndpointManager manager in this.endpointManagers.Values)
{
manager.Dispose();
}
this.endpointManagers.Clear();
}
}
}
}
\ No newline at end of file
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Connection;
using VizConnectC;
using VIZ.Framework.Core;
using System.Web.WebSockets;
using VIZ.Package.Domain;
namespace VIZ.Package.Connection
{
/// <summary>
/// Viz终结点管理器
/// </summary>
public class VizEndpointManager : IPackageEndpointManager, IDisposable
{
/// <summary>
/// 日志
/// </summary>
private static ILog log = LogManager.GetLogger(typeof(VizEndpointManager));
/// <summary>
/// VIZ总结点管理器
/// </summary>
/// <param name="key">键</param>
/// <param name="remoteIP">IP地址</param>
/// <param name="remotePort">端口</param>
public VizEndpointManager(string key, string remoteIP, int remotePort)
{
this.Key = key;
this.RemoteIP = remoteIP;
this.RemotePort = remotePort;
this.vizEnginePool = new VizEnginePool();
this.vizEnginePool.Connected += VizEnginePool_Connected;
this.vizEnginePool.Disconnected += VizEnginePool_Disconnected;
this.vizEnginePool.AddRenderer(remoteIP, remotePort);
}
/// <summary>
/// 键
/// </summary>
public string Key { get; private set; }
/// <summary>
/// 远端IP
/// </summary>
public string RemoteIP { get; private set; }
/// <summary>
/// 远端端口
/// </summary>
public int RemotePort { get; private set; }
/// <summary>
/// 是否处于连接状态
/// </summary>
public bool IsConnected { get; private set; }
/// <summary>
/// 连接状态改变事件参数
/// </summary>
public event EventHandler<ConnectionStateChangedEventArgs> ConnectionStateChanged;
/// <summary>
/// VIZ连接
/// </summary>
public VizConnection VizConnection { get; internal set; }
/// <summary>
/// 引擎连接池
/// </summary>
private VizEnginePool vizEnginePool;
/// <summary>
/// 连接
/// </summary>
public bool Connect()
{
return this.vizEnginePool.Connect();
}
/// <summary>
/// 断开连接
/// </summary>
public void Disconnect()
{
this.vizEnginePool.Disconnect();
}
/// <summary>
/// 发送消息
/// </summary>
/// <param name="message">消息</param>
public void Send(string message)
{
this.vizEnginePool.Send(message);
}
/// <summary>
/// 请求返回
/// </summary>
/// <param name="message">消息</param>
/// <returns>返回值</returns>
public string Request(string message)
{
return this.vizEnginePool.Request(message);
}
/// <summary>
/// 销毁
/// </summary>
public void Dispose()
{
this.vizEnginePool?.Disconnect();
this.vizEnginePool?.Dispose();
this.vizEnginePool = null;
}
/// <summary>
/// 断开连接时触发
/// </summary>
private void VizEnginePool_Disconnected(object sender, VizEnginePool.ConnectionEventArgs e)
{
this.IsConnected = false;
this.ConnectionStateChanged?.Invoke(this, new ConnectionStateChangedEventArgs(this, false));
}
/// <summary>
/// 连接时触发
/// </summary>
private void VizEnginePool_Connected(object sender, VizEnginePool.ConnectionEventArgs e)
{
this.IsConnected = true;
this.ConnectionStateChanged?.Invoke(this, new ConnectionStateChangedEventArgs(this, true));
}
}
}
<?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>{421527F6-37B8-4615-9317-FFD5E272181B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VIZ.Package.Connection</RootNamespace>
<AssemblyName>VIZ.Package.Connection</AssemblyName>
<TargetFrameworkVersion>v4.8</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>
</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>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<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" />
<Reference Include="VizConnectC">
<HintPath>..\Lib\VizConnectC.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Protocol\ITVPEndpointManager.cs" />
<Compile Include="Protocol\VIZ\VizConnection.cs" />
<Compile Include="Protocol\VIZ\VizEndpointManager.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Connection\VIZ.Framework.Connection.csproj">
<Project>{e07528dd-9dee-47c2-b79d-235ecfa6b003}</Project>
<Name>VIZ.Framework.Connection</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Core\VIZ.Framework.Core.csproj">
<Project>{75b39591-4bc3-4b09-bd7d-ec9f67efa96e}</Project>
<Name>VIZ.Framework.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Domain\VIZ.Framework.Domain.csproj">
<Project>{28661e82-c86a-4611-a028-c34f6ac85c97}</Project>
<Name>VIZ.Framework.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Storage\VIZ.Framework.Storage.csproj">
<Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project>
<Name>VIZ.Framework.Storage</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.Package.Domain\VIZ.Package.Domain.csproj">
<Project>{dbaeae47-1f2d-4b05-82c3-abf7cc33aa2d}</Project>
<Name>VIZ.Package.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.Package.Storage\VIZ.Package.Storage.csproj">
<Project>{5bf08a07-9405-4f5d-a7f7-9d9ee17d6dd0}</Project>
<Name>VIZ.Package.Storage</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.14" targetFramework="net48" />
</packages>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Windows;
using VIZ.Framework.Domain;
using VIZ.Package.Plugin;
using VIZ.Package.Storage;
namespace VIZ.Package.Domain
{
/// <summary>
/// 应用程序域
/// </summary>
public class ApplicationDomainEx : ApplicationDomain
{
// =============================================================
// 窗口
// =============================================================
/// <summary>
/// 登录窗口
/// </summary>
public static Window LoginWindow { get; set; }
/// <summary>
/// 主窗口
/// </summary>
public static Window MainWindow { get; set; }
/// <summary>
/// 主窗口类型
/// </summary>
public static Type MainWindowType { get; set; }
// =============================================================
// 数据
// =============================================================
/// <summary>
/// 本地数据
/// </summary>
public static LocalDbContext LocalDbContext { get; set; }
// =============================================================
// 配置
// =============================================================
/// <summary>
/// Viz配置
/// </summary>
public static VizConfigEntity VizConfig { get; set; }
/// <summary>
/// 插件信息
/// </summary>
public static List<PluginInfo> PluginInfos { get; set; }
// =============================================================
// 其他
// =============================================================
/// <summary>
/// 预览连接
/// </summary>
public static ConnModel PreviewConn { get; set; }
/// <summary>
/// Viz预览进程
/// </summary>
public static Process VizPreviewProcess { get; set; }
/// <summary>
/// Viz预览渲染器名称
/// </summary>
public static string VizPreviewRenderer { get; set; }
/// <summary>
/// 当前页
/// </summary>
public static PageModelBase CurrentPage { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Connection;
namespace VIZ.Package.Domain
{
/// <summary>
/// 包装终结点管理器
/// </summary>
public interface IPackageEndpointManager : IDisposable
{
/// <summary>
/// 连接状态改变事件参数
/// </summary>
event EventHandler<ConnectionStateChangedEventArgs> ConnectionStateChanged;
/// <summary>
/// 连接
/// </summary>
bool Connect();
/// <summary>
/// 断开连接
/// </summary>
void Disconnect();
/// <summary>
/// 发送消息
/// </summary>
/// <param name="message">消息</param>
void Send(string message);
/// <summary>
/// 请求返回
/// </summary>
/// <param name="message">消息</param>
/// <returns>返回值</returns>
string Request(string message);
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Domain
{
/// <summary>
/// 模块插件ID集合
/// </summary>
public static class ModulePluginIds
{
/// <summary>
/// 日志
/// </summary>
public const string LOG = "LOG";
/// <summary>
/// Viz预览
/// </summary>
public const string VIZ_PREVIEW = "VIZ_PREVIEW";
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Domain
{
/// <summary>
/// 视图服务键
/// </summary>
public static class ViewServiceKeys
{
/// <summary>
/// 主视图服务
/// </summary>
public const string MAIN_VIEW_SERVICE = "MAIN_VIEW_SERVICE";
/// <summary>
/// 日志服务
/// </summary>
public const string LOG_VIEW_SERVICE = "LOG_VIEW_SERVICE";
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Domain
{
/// <summary>
/// 页切换命令
/// </summary>
public class PageChangedMessage
{
/// <summary>
/// 页
/// </summary>
public PageModelBase Page { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Domain
{
/// <summary>
/// 页初始化完成消息
/// </summary>
public class PageInitedMessage
{
/// <summary>
/// 页
/// </summary>
public PageModelBase Page { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Domain
{
/// <summary>
/// Viz预览准备完毕消息
/// </summary>
public class VizPreviewReadyMessage
{
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.Package.Domain
{
/// <summary>
/// 连接分组模型
/// </summary>
public class ConnGroupModel : ModelBase
{
#region GroupID -- 分组ID
private Guid groupID;
/// <summary>
/// 分组ID
/// </summary>
public Guid GroupID
{
get { return groupID; }
set { groupID = value; this.RaisePropertyChanged(nameof(GroupID)); }
}
#endregion
#region Name -- 名称
private string name;
/// <summary>
/// 名称
/// </summary>
public string Name
{
get { return name; }
set { name = value; this.RaisePropertyChanged(nameof(Name)); }
}
#endregion
#region IsEnabled -- 是否启用
private bool isEnabled;
/// <summary>
/// 是否启用
/// </summary>
public bool IsEnabled
{
get { return isEnabled; }
set { isEnabled = value; this.RaisePropertyChanged(nameof(IsEnabled)); }
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.Package.Storage;
namespace VIZ.Package.Domain
{
/// <summary>
/// 连接模型
/// </summary>
public class ConnModel : ModelBase, IDisposable
{
#region ConnID -- 连接ID
private Guid connID;
/// <summary>
/// 连接ID
/// </summary>
public Guid ConnID
{
get { return connID; }
set { connID = value; this.RaisePropertyChanged(nameof(ConnID)); }
}
#endregion
#region GroupID -- 分组ID
private Guid groupID;
/// <summary>
/// 分组ID
/// </summary>
public Guid GroupID
{
get { return groupID; }
set { groupID = value; this.RaisePropertyChanged(nameof(GroupID)); }
}
#endregion
#region IP -- IP地址
private string ip;
/// <summary>
/// IP地址
/// </summary>
public string IP
{
get { return ip; }
set { ip = value; this.RaisePropertyChanged(nameof(IP)); }
}
#endregion
#region Port -- 端口
private int port;
/// <summary>
/// 端口
/// </summary>
public int Port
{
get { return port; }
set { port = value; this.RaisePropertyChanged(nameof(Port)); }
}
#endregion
#region Remark -- 备注
private string remark;
/// <summary>
/// 备注
/// </summary>
public string Remark
{
get { return remark; }
set { remark = value; this.RaisePropertyChanged(nameof(Remark)); }
}
#endregion
#region EngineType -- 引擎类型
private EngineType engineType;
/// <summary>
/// 引擎类型
/// </summary>
public EngineType EngineType
{
get { return engineType; }
set { engineType = value; this.RaisePropertyChanged(nameof(EngineType)); }
}
#endregion
#region IsEnabled -- 是否启用
private bool isEnabled;
/// <summary>
/// 是否启用
/// </summary>
public bool IsEnabled
{
get { return isEnabled; }
set { isEnabled = value; this.RaisePropertyChanged(nameof(IsEnabled)); }
}
#endregion
#region IsConnected -- 是否处于连接状态
private bool isConnected;
/// <summary>
/// 是否处于连接状态
/// </summary>
public bool IsConnected
{
get { return isConnected; }
set { isConnected = value; this.RaisePropertyChanged(nameof(IsConnected)); }
}
#endregion
/// <summary>
/// 连接终结点
/// </summary>
public IPackageEndpointManager EndpointManager { get; private set; }
/// <summary>
/// 初始化终结点管理器
/// </summary>
/// <param name="endpointManager">终结点管理器</param>
public void InitEndpointManager(IPackageEndpointManager endpointManager)
{
if (this.EndpointManager != null)
{
this.EndpointManager.ConnectionStateChanged -= EndpointManager_ConnectionStateChanged;
}
this.EndpointManager = endpointManager;
this.EndpointManager.ConnectionStateChanged -= EndpointManager_ConnectionStateChanged;
this.EndpointManager.ConnectionStateChanged += EndpointManager_ConnectionStateChanged;
}
/// <summary>
/// 销毁
/// </summary>
public void Dispose()
{
this.EndpointManager?.Dispose();
this.EndpointManager = null;
}
/// <summary>
/// 终结点连接状态改变时触发
/// </summary>
private void EndpointManager_ConnectionStateChanged(object sender, Framework.Connection.ConnectionStateChangedEventArgs e)
{
WPFHelper.BeginInvoke(() =>
{
this.IsConnected = e.IsConnected;
});
}
}
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.Package.Domain
{
/// <summary>
/// 页分组模型
/// </summary>
public class PageGroupModel : ModelBase
{
#region GroupID -- 分组ID
private Guid guidID;
/// <summary>
/// 分组编号
/// </summary>
public Guid GroupID
{
get { return guidID; }
set { guidID = value; this.RaisePropertyChanged(nameof(GroupID)); }
}
#endregion
#region GroupName -- 分组名称
private string groupName;
/// <summary>
/// 分组名称
/// </summary>
public string GroupName
{
get { return groupName; }
set { groupName = value; this.RaisePropertyChanged(nameof(GroupName)); }
}
#endregion
#region Pages -- 页集合
private ObservableCollection<PageModel> pages;
/// <summary>
/// 页集合
/// </summary>
public ObservableCollection<PageModel> Pages
{
get { return pages; }
set { pages = value; this.RaisePropertyChanged(nameof(Pages)); }
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.Package.Storage;
namespace VIZ.Package.Domain
{
/// <summary>
/// 页模型
/// </summary>
public class PageModel : PageModelBase
{
#region PageID -- ID
private Guid pageID;
/// <summary>
/// 页ID
/// </summary>
public Guid PageID
{
get { return pageID; }
set { pageID = value; this.RaisePropertyChanged(nameof(PageID)); }
}
#endregion
#region PageGroupID -- 所属页分组ID
private Guid pageGroupID;
/// <summary>
/// 所属页分组ID
/// </summary>
public Guid PageGroupID
{
get { return pageGroupID; }
set { pageGroupID = value; this.RaisePropertyChanged(nameof(PageGroupID)); }
}
#endregion
#region TemplateID -- 模板ID
private Guid templateID;
/// <summary>
/// 模板ID
/// </summary>
public Guid TemplateID
{
get { return templateID; }
set { templateID = value; this.RaisePropertyChanged(nameof(TemplateID)); }
}
#endregion
#region PluginID -- 插件ID
private string pluginID;
/// <summary>
/// 插件ID
/// </summary>
public string PluginID
{
get { return pluginID; }
set { pluginID = value; this.RaisePropertyChanged(nameof(PluginID)); }
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.Package.Storage;
namespace VIZ.Package.Domain
{
/// <summary>
/// 页模型基类
/// </summary>
public abstract class PageModelBase : ModelBase
{
#region Scene -- 场景
private string scene;
/// <summary>
/// 场景
/// </summary>
public string Scene
{
get { return scene; }
set { scene = value; this.RaisePropertyChanged(nameof(Scene)); }
}
#endregion
#region ScenePath -- 场景路径
private string scenePath;
/// <summary>
/// 场景路径
/// </summary>
public string ScenePath
{
get { return scenePath; }
set { scenePath = value; this.RaisePropertyChanged(nameof(ScenePath)); }
}
#endregion
#region ThumbnailUri -- 缩略图地址
private string thumbnailUri;
/// <summary>
/// 缩略图地址
/// </summary>
public string ThumbnailUri
{
get { return thumbnailUri; }
set { thumbnailUri = value; this.RaisePropertyChanged(nameof(ThumbnailUri)); }
}
#endregion
#region Remark -- 备注
private string remark;
/// <summary>
/// 备注
/// </summary>
public string Remark
{
get { return remark; }
set { remark = value; this.RaisePropertyChanged(nameof(Remark)); }
}
#endregion
#region Layer -- 包装层
private string layer;
/// <summary>
/// 包装层
/// </summary>
public string Layer
{
get { return layer; }
set { layer = value; this.RaisePropertyChanged(nameof(Layer)); }
}
#endregion
#region EngineType -- 引擎类型
private EngineType engineType;
/// <summary>
/// 引擎类型
/// </summary>
public EngineType EngineType
{
get { return engineType; }
set { engineType = value; this.RaisePropertyChanged(nameof(EngineType)); }
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.Package.Domain
{
/// <summary>
/// 页模板模型
/// </summary>
public class PageTemplateModel : PageModelBase
{
#region TemplateID -- 模板ID
private Guid templateID;
/// <summary>
/// 模板ID
/// </summary>
public Guid TemplateID
{
get { return templateID; }
set { templateID = value; this.RaisePropertyChanged(nameof(TemplateID)); }
}
#endregion
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("VIZ.Package.Domain")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VIZ.Package.Domain")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("dbaeae47-1f2d-4b05-82c3-abf7cc33aa2d")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
<?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>{DBAEAE47-1F2D-4B05-82C3-ABF7CC33AA2D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VIZ.Package.Domain</RootNamespace>
<AssemblyName>VIZ.Package.Domain</AssemblyName>
<TargetFrameworkVersion>v4.8</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>
</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>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<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" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="ApplicationDomainEx.cs" />
<Compile Include="Enum\ModulePluginIds.cs" />
<Compile Include="Enum\ViewServiceKeys.cs" />
<Compile Include="Message\Page\PageChangedMessage.cs" />
<Compile Include="Message\Page\PageInitedMessage.cs" />
<Compile Include="Message\Viz\VizPreviewReadyMessage.cs" />
<Compile Include="Model\Conn\ConnGroupModel.cs" />
<Compile Include="Model\Conn\ConnModel.cs" />
<Compile Include="Core\IPackageEndpointManager.cs" />
<Compile Include="Model\Page\PageGroupModel.cs" />
<Compile Include="Model\Page\PageModel.cs" />
<Compile Include="Model\Page\PageModelBase.cs" />
<Compile Include="Model\Page\PageTemplateModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Connection\VIZ.Framework.Connection.csproj">
<Project>{e07528dd-9dee-47c2-b79d-235ecfa6b003}</Project>
<Name>VIZ.Framework.Connection</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Core\VIZ.Framework.Core.csproj">
<Project>{75b39591-4bc3-4b09-bd7d-ec9f67efa96e}</Project>
<Name>VIZ.Framework.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Domain\VIZ.Framework.Domain.csproj">
<Project>{28661e82-c86a-4611-a028-c34f6ac85c97}</Project>
<Name>VIZ.Framework.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Storage\VIZ.Framework.Storage.csproj">
<Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project>
<Name>VIZ.Framework.Storage</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.Package.Plugin\VIZ.Package.Plugin.csproj">
<Project>{9c7d3994-340a-480f-8d06-92c562137810}</Project>
<Name>VIZ.Package.Plugin</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.Package.Storage\VIZ.Package.Storage.csproj">
<Project>{5bf08a07-9405-4f5d-a7f7-9d9ee17d6dd0}</Project>
<Name>VIZ.Package.Storage</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.14" targetFramework="net48" />
</packages>
\ No newline at end of file
<UserControl x:Class="VIZ.Package.Module.LoginView"
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:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:local="clr-namespace:VIZ.Package.Module"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:LoginViewModel}"
d:DesignHeight="450" d:DesignWidth="800">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Loaded" Command="{Binding Path=LoadedCommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
<Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="120"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!-- 引擎 -->
<TextBlock Text="引擎:" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0"></TextBlock>
<dxe:ComboBoxEdit Grid.Row="0" Grid.Column="1" Height="30" IsTextEditable="False"
ItemsSource="{Binding Path=EngineFullTypes}"
SelectedItem="{Binding Path=SelectedEngineFullType,Mode=TwoWay}"
DisplayMember="Description">
</dxe:ComboBoxEdit>
<!-- 节目 -->
<TextBlock Text="节目:" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0"></TextBlock>
<dxe:ComboBoxEdit Grid.Row="1" Grid.Column="1" Height="30" IsTextEditable="False"
ItemsSource="{Binding Path=PluginGroups}"
SelectedItem="{Binding Path=SelectedPluginGroup,Mode=TwoWay}">
</dxe:ComboBoxEdit>
<!-- IP -->
<TextBlock Text="IP:" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0"></TextBlock>
<dxe:TextEdit Grid.Row="2" Grid.Column="1" Height="30"
EditValue="{Binding GH_IP,Mode=TwoWay}"></dxe:TextEdit>
<!-- 端口 -->
<TextBlock Text="端口:" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0"></TextBlock>
<dxe:TextEdit Grid.Row="3" Grid.Column="1" Height="30" MaskType="RegEx"
Mask="[0-9]{0,7}"
EditValue="{Binding GH_Port,Mode=TwoWay}"></dxe:TextEdit>
<!-- ServerName -->
<TextBlock Text="服务名:" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0"></TextBlock>
<dxe:TextEdit Grid.Row="4" Grid.Column="1" Height="30"
EditValue="{Binding GH_ServerName,Mode=TwoWay}"></dxe:TextEdit>
<!-- UserName -->
<TextBlock Text="用户名:" Grid.Row="5" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0"></TextBlock>
<dxe:TextEdit Grid.Row="5" Grid.Column="1" Height="30"
EditValue="{Binding VIZ_UserName,Mode=TwoWay}"></dxe:TextEdit>
<!-- Password -->
<TextBlock Text="密码:" Grid.Row="6" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0"></TextBlock>
<dxe:TextEdit Grid.Row="6" Grid.Column="1" Height="30"
EditValue="{Binding VIZ_Password,Mode=TwoWay}"></dxe:TextEdit>
<!-- 按钮组 -->
<Button Grid.Row="7" Width="120" Height="40" Grid.Column="1" Content="登录" HorizontalAlignment="Right"
Command="{Binding Path=LoginCommand}"></Button>
</Grid>
<dx:WaitIndicator DeferedVisibility="{Binding IsLoading}" Content="Loading..." />
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VIZ.Framework.Core;
namespace VIZ.Package.Module
{
/// <summary>
/// LoginView.xaml 的交互逻辑
/// </summary>
public partial class LoginView : UserControl
{
public LoginView()
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new LoginViewModel());
}
}
}
using DevExpress.Utils.About;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Service;
using VIZ.Package.Storage;
namespace VIZ.Package.Module
{
/// <summary>
/// 登录视图模型
/// </summary>
public class LoginViewModel : ViewModelBase
{
public LoginViewModel()
{
// 初始化命令
this.InitCommand();
}
/// <summary>
/// 初始化命令
/// </summary>
private void InitCommand()
{
this.LoadedCommand = new VCommand(this.Loaded);
this.LoginCommand = new VCommand(this.Login);
}
// ============================================================
// Service & Controller
// ============================================================
/// <summary>
/// 插件服务
/// </summary>
private PluginService pluginService = new PluginService();
// ============================================================
// Property
// ============================================================
#region IsLoading -- 是否正在加载
private bool isLoading;
/// <summary>
/// 是否正在加载
/// </summary>
public bool IsLoading
{
get { return isLoading; }
set { isLoading = value; this.RaisePropertyChanged(nameof(IsLoading)); }
}
#endregion
#region EngineFullTypes -- 引擎类型集合
private List<EnumModel> engineFullTypes = EnumHelper.GetEnumModels<EngineFullType>();
/// <summary>
/// 引擎类型集合
/// </summary>
public List<EnumModel> EngineFullTypes
{
get { return engineFullTypes; }
set { engineFullTypes = value; this.RaisePropertyChanged(nameof(EngineFullTypes)); }
}
#endregion
#region SelectedEngineFullType -- 选中的引擎类型
private EnumModel selectedEngineFullType;
/// <summary>
/// 选中的引擎类型
/// </summary>
public EnumModel SelectedEngineFullType
{
get { return selectedEngineFullType; }
set { selectedEngineFullType = value; this.RaisePropertyChanged(nameof(SelectedEngineFullType)); }
}
#endregion
#region PluginGroups -- 插件分组
private List<string> pluginGroups;
/// <summary>
/// 插件分组
/// </summary>
public List<string> PluginGroups
{
get { return pluginGroups; }
set { pluginGroups = value; this.RaisePropertyChanged(nameof(PluginGroups)); }
}
#endregion
#region SelectedPluginGroup -- 选中的插件分组
private string selectedPluginGroup;
/// <summary>
/// 选中的插件分组
/// </summary>
public string SelectedPluginGroup
{
get { return selectedPluginGroup; }
set { selectedPluginGroup = value; this.RaisePropertyChanged(nameof(SelectedPluginGroup)); }
}
#endregion
#region GH_IP -- GH IP
private string gh_ip;
/// <summary>
/// GH_IP
/// </summary>
public string GH_IP
{
get { return gh_ip; }
set { gh_ip = value; this.RaisePropertyChanged(nameof(GH_IP)); }
}
#endregion
#region GH_Port -- GH 端口
private int gh_port;
/// <summary>
/// GH 端口
/// </summary>
public int GH_Port
{
get { return gh_port; }
set { gh_port = value; this.RaisePropertyChanged(nameof(GH_Port)); }
}
#endregion
#region GH_ServerName -- GH 服务名
private string gh_serverName;
/// <summary>
/// GH 服务名
/// </summary>
public string GH_ServerName
{
get { return gh_serverName; }
set { gh_serverName = value; this.RaisePropertyChanged(nameof(GH_ServerName)); }
}
#endregion
#region VIZ_UserName -- VIZ 用户名
private string viz_userName;
/// <summary>
/// VIZ 用户名
/// </summary>
public string VIZ_UserName
{
get { return viz_userName; }
set { viz_userName = value; this.RaisePropertyChanged(nameof(VIZ_UserName)); }
}
#endregion
#region VIZ_Password -- VIZ 密码
private string viz_password;
/// <summary>
/// VIZ 密码
/// </summary>
public string VIZ_Password
{
get { return viz_password; }
set { viz_password = value; this.RaisePropertyChanged(nameof(VIZ_Password)); }
}
#endregion
// ============================================================
// Command
// ============================================================
#region LoadedCommand -- 加载命令
/// <summary>
/// 加载命令
/// </summary>
public VCommand LoadedCommand { get; set; }
/// <summary>
/// 加载
/// </summary>
private void Loaded()
{
if (this.IsAlreadyLoaded)
return;
this.IsAlreadyLoaded = true;
this.IsLoading = true;
ThreadHelper.SafeRun(action: () =>
{
// Step 1. 加载Viz配置信息
VizConfigEntity vizConfig = ApplicationDomainEx.LocalDbContext.VizConfig.FindAll().FirstOrDefault();
vizConfig = vizConfig ?? new VizConfigEntity();
ApplicationDomainEx.VizConfig = vizConfig;
this.UpdateVizConfig(vizConfig);
// Step 2. 加载插件信息
ApplicationDomainEx.PluginInfos = this.pluginService.LoadPluginInfos();
this.UpdatePluginInfos(vizConfig);
}, final: () =>
{
WPFHelper.BeginInvoke(() =>
{
this.IsLoading = false;
});
});
}
/// <summary>
/// 更新Viz配置
/// </summary>
/// <param name="vizConfig">Viz配置</param>
private void UpdateVizConfig(VizConfigEntity vizConfig)
{
WPFHelper.Invoke(() =>
{
this.GH_IP = vizConfig.GH_IP;
this.GH_Port = vizConfig.GH_Port;
this.GH_ServerName = vizConfig.GH_ServerName;
this.VIZ_UserName = vizConfig.VIZ_UserName;
this.VIZ_Password = vizConfig.VIZ_Password;
this.SelectedEngineFullType = this.EngineFullTypes.FirstOrDefault(p => (EngineFullType)p.Key == vizConfig.EngineFullType);
});
}
/// <summary>
/// 更新插件信息
/// </summary>
/// <param name="vizConfig">Viz配置</param>
private void UpdatePluginInfos(VizConfigEntity vizConfig)
{
WPFHelper.Invoke(() =>
{
this.PluginGroups = ApplicationDomainEx.PluginInfos.GroupBy(p => p.Group).Select(p => p.Key).ToList();
this.SelectedPluginGroup = this.PluginGroups.FirstOrDefault(p => p == vizConfig.PluginGroup);
});
}
#endregion
#region LoginCommand -- 登录命令
/// <summary>
/// 登录命令
/// </summary>
public VCommand LoginCommand { get; set; }
/// <summary>
/// 登录
/// </summary>
private void Login()
{
VizConfigEntity vizConfig = ApplicationDomainEx.VizConfig;
vizConfig.GH_IP = this.GH_IP;
vizConfig.GH_Port = this.GH_Port;
vizConfig.GH_ServerName = this.GH_ServerName;
vizConfig.VIZ_UserName = this.VIZ_UserName;
vizConfig.VIZ_Password = this.VIZ_Password;
vizConfig.PluginGroup = this.SelectedPluginGroup;
vizConfig.EngineFullType = (EngineFullType)this.SelectedEngineFullType.Key;
ApplicationDomainEx.LocalDbContext.VizConfig.Update(vizConfig);
Window loginWindow = this.GetWindow();
loginWindow.ShowInTaskbar = false;
ApplicationDomainEx.MainWindow = ApplicationDomainEx.MainWindowType.Assembly.CreateInstance(ApplicationDomainEx.MainWindowType.FullName) as Window;
ApplicationDomainEx.MainWindow.Show();
loginWindow.Hide();
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.Package.Module
{
/// <summary>
/// 主视图服务
/// </summary>
public interface IMainViewService : IService
{
/// <summary>
/// 保存布局
/// </summary>
void SaveLayout();
/// <summary>
/// 加载布局
/// </summary>
void LoadLayout();
}
}
<UserControl x:Class="VIZ.Package.Module.MainTopView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VIZ.Package.Module"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace VIZ.Package.Module
{
/// <summary>
/// MainTopView.xaml 的交互逻辑
/// </summary>
public partial class MainTopView : UserControl
{
public MainTopView()
{
InitializeComponent();
}
}
}
<UserControl x:Class="VIZ.Package.Module.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:plugin="clr-namespace:VIZ.Package.Plugin;assembly=VIZ.Package.Plugin"
xmlns:local="clr-namespace:VIZ.Package.Module"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<DataTemplate DataType="{x:Type plugin:PluginInfo}">
<plugin:PluginLoader ViewType="{Binding ViewType,Mode=OneWay}"></plugin:PluginLoader>
</DataTemplate>
<Style TargetType="{x:Type dxdo:LayoutPanel}">
<Setter Property="BindableName" Value="{Binding ID}" />
<Setter Property="Caption" Value="{Binding Name}" />
<Setter Property="ShowCloseButton" Value="False"></Setter>
</Style>
<Style TargetType="{x:Type dxdo:DocumentPanel}">
<Setter Property="BindableName" Value="{Binding ID}" />
<Setter Property="Caption" Value="{Binding Name}" />
<Setter Property="ShowCloseButton" Value="False"></Setter>
</Style>
</UserControl.Resources>
<dxdo:DockLayoutManager x:Name="dockLayoutManager" FloatingMode="Desktop" EnableWin32Compatibility="True">
<dxdo:LayoutGroup ItemsSource="{Binding ItemsSource}"></dxdo:LayoutGroup>
</dxdo:DockLayoutManager>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VIZ.Framework.Core;
namespace VIZ.Package.Module
{
/// <summary>
/// MainView.xaml 的交互逻辑
/// </summary>
public partial class MainView : UserControl
{
public MainView()
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new MainViewModel());
}
}
}
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Plugin;
namespace VIZ.Package.Module
{
/// <summary>
/// 主视图模型
/// </summary>
public class MainViewModel : ViewModelBase, IMainViewService
{
public MainViewModel()
{
ApplicationDomainEx.ServiceManager.AddService(ViewServiceKeys.MAIN_VIEW_SERVICE, this);
}
// ============================================================
// Service & Controller
// ============================================================
// ============================================================
// Property
// ============================================================
#region ItemsSource -- 视图项
private ObservableCollection<PluginInfo> itemsSource = ApplicationDomainEx.PluginInfos.Where(p => p.PluginType == PluginType.Module).ToObservableCollection();
/// <summary>
/// 视图项
/// </summary>
public ObservableCollection<PluginInfo> ItemsSource
{
get { return itemsSource; }
set { itemsSource = value; this.RaisePropertyChanged(nameof(ItemsSource)); }
}
#endregion
// ============================================================
// Command
// ============================================================
// ============================================================
// Public Function
// ============================================================
/// <summary>
/// 保存布局
/// </summary>
public void SaveLayout()
{
MainView view = this.GetView<MainView>();
if (view == null)
return;
string path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "layout.xml");
view.dockLayoutManager.SaveLayoutToXml(path);
}
/// <summary>
/// 加载布局
/// </summary>
public void LoadLayout()
{
MainView view = this.GetView<MainView>();
if (view == null)
return;
string path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "layout.xml");
view.dockLayoutManager.RestoreLayoutFromXml(path);
}
}
}
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("VIZ.Package.Module")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VIZ.Package.Module")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
//若要开始生成可本地化的应用程序,请设置
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
//例如,如果您在源文件中使用的是美国英语,
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
//对以下 NeutralResourceLanguage 特性的注释。 更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(未在页面中找到资源时使用,
//或应用程序资源字典中找到时使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(未在页面中找到资源时使用,
//、应用程序或任何主题专用资源字典中找到时使用)
)]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace VIZ.Package.Module.Properties {
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if ((resourceMan == null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VIZ.Package.Module.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VIZ.Package.Module.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
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Module;
using VIZ.Package.Domain;
using VIZ.Package.Storage;
namespace VIZ.Package.Module
{
/// <summary>
/// 应用程序启动 -- 初始化LiteDB
/// </summary>
public class AppSetup_InitLiteDB : AppSetupBase
{
/// <summary>
/// 日志
/// </summary>
private static ILog log = LogManager.GetLogger(typeof(AppSetup_InitLiteDB));
/// <summary>
/// 描述
/// </summary>
public override string Detail { get; } = "应用程序启动 -- 初始化LiteDB";
/// <summary>
/// 执行启动
/// </summary>
/// <param name="context">应用程序启动上下文</param>
/// <returns>是否成功执行</returns>
public override bool Setup(AppSetupContext context)
{
string folder = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "db");
if (!System.IO.Directory.Exists(folder))
{
System.IO.Directory.CreateDirectory(folder);
}
string path = System.IO.Path.Combine(folder, "cache.db");
ApplicationDomainEx.LocalDbContext = new LocalDbContext(path);
return true;
}
/// <summary>
/// 执行关闭
/// </summary>
/// <param name="context">应用程序启动上下文</param>
public override void Shutdown(AppSetupContext context)
{
ApplicationDomainEx.LocalDbContext?.Dispose();
ApplicationDomainEx.LocalDbContext = null;
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Storage;
namespace VIZ.Package.Module
{
/// <summary>
/// Viz预览控制器
/// </summary>
public class VizPreviewController
{
/// <summary>
/// Viz预览控制器
/// </summary>
/// <param name="viewModel">视图模型</param>
public VizPreviewController(VizPreviewViewModel viewModel)
{
this.ViewModel = viewModel;
}
/// <summary>
/// 视图
/// </summary>
public VizPreviewViewModel ViewModel { get; private set; }
/// <summary>
/// 启动VIZ引擎
/// </summary>
/// <param name="view"></param>
/// <param name="path">引擎路径</param>
/// <param name="conn">连接模型</param>
public void StartVizEngine(VizPreviewView view, string path, ConnModel conn)
{
this.ViewModel.IsEngineReady = false;
var dpi = WPFHelper.GetDpiByGraphics();
int width = (int)(view.host.ActualWidth * (dpi.X / 96d));
int height = (int)(view.host.ActualHeight * (dpi.Y / 96d));
ImageHelper.AdjustSize(width, height, 1920, 1080, out width, out height);
IntPtr hWnd = view.host.ContainerFormHandle;
IntPtr vizHandle = IntPtr.Zero;
ThreadHelper.SafeRun(() =>
{
VizConfigEntity vizConfig = ApplicationDomainEx.VizConfig;
// Step 1. 启动进程
ApplicationDomainEx.VizPreviewProcess = new Process();
ApplicationDomainEx.VizPreviewProcess.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(path);
ApplicationDomainEx.VizPreviewProcess.StartInfo.FileName = System.IO.Path.GetFileName(path);
//VIZ3: " -o -P -db Guest:@localhost/VizDbServer:19396"
//VIZ4: "-u1 -n -M -e Guest:@localhost/VizDbServer:19396"
if (vizConfig.EngineFullType == EngineFullType.VIZ_Eng3)
{
ApplicationDomainEx.VizPreviewProcess.StartInfo.Arguments = $" -o -P -db {vizConfig.VIZ_UserName}:@{vizConfig.VIZ_IP}/{vizConfig.GH_ServerName}:{vizConfig.GH_Port}";
}
if (vizConfig.EngineFullType == EngineFullType.VIZ_Eng4)
{
//ApplicationDomainEx.LocalVizManager.VizRenderersProcess.StartInfo.Arguments = $" -o -P -db {loginInfo.VIZ_UserName}:@{loginInfo.VIZ_IP}/{loginInfo.GH_ServerName}:{loginInfo.GH_Port}";
ApplicationDomainEx.VizPreviewProcess.StartInfo.Arguments = $" -u1 -n -M -e {vizConfig.VIZ_UserName}:@{vizConfig.VIZ_IP}/{vizConfig.GH_ServerName}:{vizConfig.GH_Port}";
}
ApplicationDomainEx.VizPreviewProcess.StartInfo.UseShellExecute = true;
ApplicationDomainEx.VizPreviewProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
ApplicationDomainEx.VizPreviewProcess.Start();
// Step 2. 连接VIZ
do
{
System.Threading.Thread.Sleep(1000);
} while (!conn.EndpointManager.Connect());
// Step 3. 发送渲染命令
do
{
System.Threading.Thread.Sleep(1000);
if (vizConfig.EngineFullType == EngineFullType.VIZ_Eng3)
{
string cmd = $"RENDERER WINDOW_OPEN_ON_PARENT 0x{hWnd.ToString("X6")} {width} {height} ONAIR";
conn.EndpointManager.Send(cmd);
}
else if (string.IsNullOrWhiteSpace(ApplicationDomainEx.VizPreviewRenderer) && vizConfig.EngineFullType == EngineFullType.VIZ_Eng4)
{
// 创建 EDITOR
ApplicationDomainEx.VizPreviewRenderer = conn.EndpointManager.Request("EDITOR CREATE RENDERER");
string cmd = $"{ApplicationDomainEx.VizPreviewRenderer} WINDOW_OPEN_ON_PARENT 0x{hWnd.ToString("X6")} {width} {height} ONAIR";
conn.EndpointManager.Send(cmd);
}
WPFHelper.Invoke(() =>
{
vizHandle = view.host.TargetWindowHandle;
});
} while (vizHandle == IntPtr.Zero);
// Step 4. 启动完成
WPFHelper.BeginInvoke(() =>
{
this.ViewModel.IsEngineReady = true;
// 发送引擎嵌入完成消息
VizPreviewReadyMessage msg = new VizPreviewReadyMessage();
ApplicationDomainEx.MessageManager.Send(msg);
});
});
}
}
}
\ No newline at end of file
<UserControl x:Class="VIZ.Package.Module.VizPreviewView"
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:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:fcommon="clr-namespace:VIZ.Framework.Common;assembly=VIZ.Framework.Common"
xmlns:local="clr-namespace:VIZ.Package.Module"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=local:VizPreviewViewModel}"
d:DesignHeight="450" d:DesignWidth="800">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Loaded" Command="{Binding Path=LoadedCommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<!-- 按钮组 -->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
<Button Content="播放" Width="60" Height="30" Margin="5,0,0,0" Command="{Binding Path=PlayCommand}"></Button>
<Button Content="继续" Width="60" Height="30" Margin="5,0,0,0" Command="{Binding Path=ContinueCommand}"></Button>
<Button Content="停止" Width="60" Height="30" Margin="5,0,0,0" Command="{Binding Path=StopCommand}"></Button>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center">
<CheckBox Content="TA" Width="40" Height="30" Margin="5,0,0,0">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Checked" Command="{Binding Path=ShowTSCommand}"></dxmvvm:EventToCommand>
<dxmvvm:EventToCommand EventName="Unchecked" Command="{Binding Path=HideTSCommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
</CheckBox>
<CheckBox Content="SA" Width="40" Height="30" Margin="5,0,0,0">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Checked" Command="{Binding Path=ShowSACommand}"></dxmvvm:EventToCommand>
<dxmvvm:EventToCommand EventName="Unchecked" Command="{Binding Path=HideSACommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
</CheckBox>
<CheckBox Content="BB" Width="40" Height="30" Margin="5,0,0,0">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Checked" Command="{Binding Path=ShowBBCommand}"></dxmvvm:EventToCommand>
<dxmvvm:EventToCommand EventName="Unchecked" Command="{Binding Path=HideBBCommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
</CheckBox>
<Rectangle Width="2" VerticalAlignment="Stretch" Fill="Red"></Rectangle>
<RadioButton Content="RGB" Width="40" Height="30" Margin="5,0,0,0" IsChecked="True">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Checked" Command="{Binding Path=ShowRGBCommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
</RadioButton>
<RadioButton Content="Key" Width="40" Height="30" Margin="5,0,0,0">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Checked" Command="{Binding Path=ShowKeyCommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
</RadioButton>
<RadioButton Content="KeyedPreveiew" Width="60" Height="30" Margin="5,0,0,0">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="Checked" Command="{Binding Path=ShowKeyPreviewCommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
</RadioButton>
</StackPanel>
</Grid>
<!-- VIZ引擎 -->
<fcommon:WindowHost x:Name="host" Grid.Row="1" Background="#ff252526" BackColor="#ff252526">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand PassEventArgsToCommand="True" EventName="SizeChanged"
Command="{Binding Path=WindowHostSizeChangedCommand}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
</fcommon:WindowHost>
</Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VIZ.Framework.Core;
namespace VIZ.Package.Module
{
/// <summary>
/// VizPreviewView.xaml 的交互逻辑
/// </summary>
public partial class VizPreviewView : UserControl
{
public VizPreviewView()
{
InitializeComponent();
WPFHelper.BindingViewModel(this, new VizPreviewViewModel());
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Package.Domain;
using VIZ.Package.Plugin;
namespace VIZ.Package.Module
{
/// <summary>
/// Viz预览插件生命周期
/// </summary>
public class VizPreviewPluginLifeCycle : IPluginLifeCycle
{
/// <summary>
/// 插件ID
/// </summary>
/// <remarks>
/// 插件ID不能包含点号
/// </remarks>
public const string PLUGIN_ID = ModulePluginIds.VIZ_PREVIEW;
/// <summary>
/// 插件名称
/// </summary>
public const string PLUGIN_NAME = "Viz预览";
/// <summary>
/// 注册
/// </summary>
/// <returns>插件信息</returns>
public PluginInfo Register()
{
PluginInfo info = new PluginInfo();
info.ID = PLUGIN_ID;
info.Name = PLUGIN_NAME;
info.ViewType = typeof(VizPreviewView);
return info;
}
/// <summary>
/// 初始化
/// </summary>
public void Initialize()
{
}
/// <summary>
/// 销毁
/// </summary>
public void Dispose()
{
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="LiteDB" version="5.0.15" targetFramework="net48" />
<package id="log4net" version="2.0.14" targetFramework="net48" />
</packages>
\ No newline at end of file
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace VIZ.Package.Plugin
{
/// <summary>
/// 插件加载器
/// </summary>
public class PluginLoader : ContentControl
{
/// <summary>
/// 日志
/// </summary>
private static readonly ILog log = LogManager.GetLogger(typeof(PluginLoader));
static PluginLoader()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PluginLoader), new FrameworkPropertyMetadata(typeof(PluginLoader)));
}
#region ViewType -- 视图类型
/// <summary>
/// 视图类型
/// </summary>
public Type ViewType
{
get { return (Type)GetValue(ViewTypeProperty); }
set { SetValue(ViewTypeProperty, value); }
}
/// <summary>
/// Using a DependencyProperty as the backing store for ViewType. This enables animation, styling, binding, etc...
/// </summary>
public static readonly DependencyProperty ViewTypeProperty =
DependencyProperty.Register("ViewType", typeof(Type), typeof(PluginLoader), new PropertyMetadata(null, new PropertyChangedCallback((s, e) =>
{
(s as PluginLoader)?.ResetPluginView();
})));
#endregion
/// <summary>
/// 重置插件视图
/// </summary>
private void ResetPluginView()
{
try
{
IDisposable disposable = this.Content as IDisposable;
this.Content = null;
disposable?.Dispose();
if (this.ViewType == null)
return;
FrameworkElement view = this.ViewType.Assembly.CreateInstance(this.ViewType.FullName) as FrameworkElement;
this.Content = view;
}
catch (Exception ex)
{
log.Error(ex);
}
}
}
}
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:VIZ.Package.Plugin">
<Style TargetType="local:PluginLoader">
<Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:PluginLoader">
<Border Background="Transparent">
<ContentPresenter></ContentPresenter>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Plugin
{
/// <summary>
/// 插件生命周期
/// </summary>
public interface IPluginLifeCycle
{
/// <summary>
/// 注册
/// </summary>
/// <returns>插件信息</returns>
PluginInfo Register();
/// <summary>
/// 初始化
/// </summary>
void Initialize();
/// <summary>
/// 销毁
/// </summary>
void Dispose();
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Package.Storage;
namespace VIZ.Package.Plugin
{
/// <summary>
/// 插件信息
/// </summary>
public class PluginInfo
{
/// <summary>
/// 插件ID
/// </summary>
public string ID { get; set; }
/// <summary>
/// 分组
/// </summary>
public string Group { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 视图类型
/// </summary>
public Type ViewType { get; set; }
/// <summary>
/// 插件类型
/// </summary>
public PluginType PluginType { get; set; }
/// <summary>
/// 引擎类型筛选器
/// </summary>
public List<EngineFullType> EngineFullTypesFilter { get; set; }
/// <summary>
/// 生命周期
/// </summary>
public IPluginLifeCycle LifeCycle { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Plugin
{
/// <summary>
/// 插件类型
/// </summary>
public enum PluginType
{
/// <summary>
/// 模块插件
/// </summary>
Module,
/// <summary>
/// 页插件
/// </summary>
Pages
}
}
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("VIZ.Package.Plugin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VIZ.Package.Plugin")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
//若要开始生成可本地化的应用程序,请设置
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
//例如,如果您在源文件中使用的是美国英语,
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
//对以下 NeutralResourceLanguage 特性的注释。 更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(未在页面中找到资源时使用,
//或应用程序资源字典中找到时使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(未在页面中找到资源时使用,
//、应用程序或任何主题专用资源字典中找到时使用)
)]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace VIZ.Package.Plugin.Properties {
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if ((resourceMan == null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VIZ.Package.Plugin.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VIZ.Package.Plugin.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
\ No newline at end of file
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:VIZ.Package.Plugin">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VIZ.Package.Plugin;component/Control/PluginLoader.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9C7D3994-340A-480F-8D06-92C562137810}</ProjectGuid>
<OutputType>library</OutputType>
<RootNamespace>VIZ.Package.Plugin</RootNamespace>
<AssemblyName>VIZ.Package.Plugin</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<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>
</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>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Page Include="Control\PluginLoader.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Control\PluginLoader.cs" />
<Compile Include="Core\PluginInfo.cs" />
<Compile Include="Core\IPluginLifeCycle.cs" />
<Compile Include="Core\PluginType.cs" />
<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>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Core\VIZ.Framework.Core.csproj">
<Project>{75b39591-4bc3-4b09-bd7d-ec9f67efa96e}</Project>
<Name>VIZ.Framework.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Storage\VIZ.Framework.Storage.csproj">
<Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project>
<Name>VIZ.Framework.Storage</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.Package.Storage\VIZ.Package.Storage.csproj">
<Project>{5bf08a07-9405-4f5d-a7f7-9d9ee17d6dd0}</Project>
<Name>VIZ.Package.Storage</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.14" targetFramework="net48" />
</packages>
\ No newline at end of file
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using VIZ.Package.Domain;
using VIZ.Package.Plugin;
namespace VIZ.Package.Service
{
/// <summary>
/// 插件服务
/// </summary>
public class PluginService
{
/// <summary>
/// 日志
/// </summary>
private static ILog log = LogManager.GetLogger(typeof(PluginService));
/// <summary>
/// 包装插件前缀
/// </summary>
public const string PLUGIN_ASSEMBLY_PREFIX = "VIZ.Package.";
/// <summary>
/// 加载插件信息集合
/// </summary>
/// <returns>插件信息集合</returns>
public List<PluginInfo> LoadPluginInfos()
{
List<PluginInfo> list = new List<PluginInfo>();
string[] files = System.IO.Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory);
Type pluginLifeCycleType = typeof(IPluginLifeCycle);
foreach (string file in files)
{
string fileName = System.IO.Path.GetFileName(file);
if (!fileName.StartsWith(PLUGIN_ASSEMBLY_PREFIX) || !fileName.EndsWith(".dll"))
continue;
Assembly assembly = Assembly.LoadFile(file);
string version = assembly.GetCustomAttribute<AssemblyVersionAttribute>()?.Version;
Type[] types = assembly.GetTypes();
foreach (Type type in types)
{
if (!type.IsClass)
continue;
if (!pluginLifeCycleType.IsAssignableFrom(type))
continue;
IPluginLifeCycle lifeCycle = type.Assembly.CreateInstance(type.FullName) as IPluginLifeCycle;
if (lifeCycle == null)
{
log.Error($"init plugin type: {type.FullName} error.");
continue;
}
PluginInfo info = lifeCycle.Register();
list.Add(info);
}
}
return list;
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("VIZ.Package.Service")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VIZ.Package.Service")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("bf693c2d-3de8-463b-8394-a0667dca7b42")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
<?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>{BF693C2D-3DE8-463B-8394-A0667DCA7B42}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VIZ.Package.Service</RootNamespace>
<AssemblyName>VIZ.Package.Service</AssemblyName>
<TargetFrameworkVersion>v4.8</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>
</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>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<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="Logic\Plugin\PluginService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Viz\VizCommandService.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="DB\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Core\VIZ.Framework.Core.csproj">
<Project>{75b39591-4bc3-4b09-bd7d-ec9f67efa96e}</Project>
<Name>VIZ.Framework.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Domain\VIZ.Framework.Domain.csproj">
<Project>{28661e82-c86a-4611-a028-c34f6ac85c97}</Project>
<Name>VIZ.Framework.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Storage\VIZ.Framework.Storage.csproj">
<Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project>
<Name>VIZ.Framework.Storage</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.Package.Domain\VIZ.Package.Domain.csproj">
<Project>{dbaeae47-1f2d-4b05-82c3-abf7cc33aa2d}</Project>
<Name>VIZ.Package.Domain</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.Package.Plugin\VIZ.Package.Plugin.csproj">
<Project>{9c7d3994-340a-480f-8d06-92c562137810}</Project>
<Name>VIZ.Package.Plugin</Name>
</ProjectReference>
<ProjectReference Include="..\VIZ.Package.Storage\VIZ.Package.Storage.csproj">
<Project>{5bf08a07-9405-4f5d-a7f7-9d9ee17d6dd0}</Project>
<Name>VIZ.Package.Storage</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Package.Domain;
using VIZ.Package.Storage;
namespace VIZ.Package.Service
{
/// <summary>
/// Viz命令服务
/// </summary>
public class VizCommandService
{
/// <summary>
/// 设置场景
/// </summary>
/// <param name="conn">连接</param>
/// <param name="scene">场景</param>
/// <param name="layer">图层</param>
public void SetObject(ConnModel conn, string scene, VizLayer layer)
{
if (conn == null)
throw new ArgumentNullException(nameof(conn));
conn.EndpointManager.Send($"RENDERER*{layer} SET_OBJECT SCENE*{scene}");
}
/// <summary>
/// 播放
/// </summary>
/// <param name="conn">连接</param>
/// <param name="scene">场景</param>
/// <param name="layer">图层</param>
public void Start(ConnModel conn, string scene, VizLayer layer)
{
if (conn == null)
throw new ArgumentNullException(nameof(conn));
if (string.IsNullOrWhiteSpace(scene))
{
conn.EndpointManager.Send($"RENDERER*{layer}*STAGE START");
}
else
{
conn.EndpointManager.Send($"RENDERER*{layer}*STAGE*DIRECTOR*{scene} START");
}
}
/// <summary>
/// 继续
/// </summary>
/// <param name="conn">连接</param>
/// <param name="scene">场景</param>
/// <param name="layer">图层</param>
public void Continue(ConnModel conn, string scene, VizLayer layer)
{
if (conn == null)
throw new ArgumentNullException(nameof(conn));
if (string.IsNullOrWhiteSpace(scene))
{
conn.EndpointManager.Send($"RENDERER*{layer}*STAGE CONTINUE");
}
else
{
conn.EndpointManager.Send($"RENDERER*{layer}*STAGE*DIRECTOR*{scene} CONTINUE");
}
}
/// <summary>
/// 停止
/// </summary>
/// <param name="conn">连接</param>
/// <param name="scene">场景</param>
/// <param name="layer">图层</param>
public void Stop(ConnModel conn, string scene, VizLayer layer)
{
if (conn == null)
throw new ArgumentNullException(nameof(conn));
if (string.IsNullOrWhiteSpace(scene))
{
conn.EndpointManager.Send($"RENDERER*{layer}*STAGE STOP");
}
else
{
conn.EndpointManager.Send($"RENDERER*{layer}*STAGE*DIRECTOR*{scene} STOP");
}
}
/// <summary>
/// 显示安全框
/// </summary>
/// <param name="conn">连接</param>
/// <param name="show">是否显示</param>
public void ShowTS(ConnModel conn, bool show)
{
if (conn == null)
throw new ArgumentNullException(nameof(conn));
VizConfigEntity config = ApplicationDomainEx.VizConfig;
if (config.EngineFullType == EngineFullType.VIZ_Eng3)
{
conn.EndpointManager.Send($"RENDERER SET_TITLE_AREA {(show ? 1 : 0)}");
}
else if (config.EngineFullType == EngineFullType.VIZ_Eng4)
{
conn.EndpointManager.Send($"{ApplicationDomainEx.VizPreviewRenderer} SET_TITLE_AREA {(show ? 1 : 0)}");
}
}
/// <summary>
/// 显示安区域
/// </summary>
/// <param name="conn">连接</param>
/// <param name="show">是否显示</param>
public void ShowSA(ConnModel conn, bool show)
{
if (conn == null)
throw new ArgumentNullException(nameof(conn));
VizConfigEntity config = ApplicationDomainEx.VizConfig;
if (config.EngineFullType == EngineFullType.VIZ_Eng3)
{
conn.EndpointManager.Send($"RENDERER SET_SAFE_AREA {(show ? 1 : 0)}");
}
else if (config.EngineFullType == EngineFullType.VIZ_Eng4)
{
conn.EndpointManager.Send($"{ApplicationDomainEx.VizPreviewRenderer} SET_SAFE_AREA {(show ? 1 : 0)}");
}
}
/// <summary>
/// 显示边界框
/// </summary>
/// <param name="conn">连接</param>
/// <param name="show">是否显示</param>
public void ShowBB(ConnModel conn, bool show)
{
if (conn == null)
throw new ArgumentNullException(nameof(conn));
VizConfigEntity config = ApplicationDomainEx.VizConfig;
if (config.EngineFullType == EngineFullType.VIZ_Eng3)
{
conn.EndpointManager.Send($"RENDERER SHOW_BOUNDING_BOX {(show ? 1 : 0)}");
}
else if (config.EngineFullType == EngineFullType.VIZ_Eng4)
{
conn.EndpointManager.Send($"{ApplicationDomainEx.VizPreviewRenderer} SHOW_BOUNDING_BOX {(show ? 1 : 0)}");
}
}
/// <summary>
/// 显示RGB
/// </summary>
/// <param name="conn">连接</param>
public void ShowRGB(ConnModel conn)
{
if (conn == null)
throw new ArgumentNullException(nameof(conn));
VizConfigEntity config = ApplicationDomainEx.VizConfig;
if (config.EngineFullType == EngineFullType.VIZ_Eng3)
{
conn.EndpointManager.Send($"RENDERER SET_KEY 0,RENDERER*KEY_INTERNAL*ACTIVE SET 0");
}
else if (config.EngineFullType == EngineFullType.VIZ_Eng4)
{
conn.EndpointManager.Send($"{ApplicationDomainEx.VizPreviewRenderer} SET_KEY 0,RENDERER*KEY_INTERNAL*ACTIVE SET 0");
}
}
/// <summary>
/// 显示键
/// </summary>
/// <param name="conn">连接</param>
public void ShowKey(ConnModel conn)
{
if (conn == null)
throw new ArgumentNullException(nameof(conn));
VizConfigEntity config = ApplicationDomainEx.VizConfig;
if (config.EngineFullType == EngineFullType.VIZ_Eng3)
{
conn.EndpointManager.Send($"RENDERER SET_KEY 1,RENDERER*KEY_INTERNAL*ACTIVE SET 0");
}
else if (config.EngineFullType == EngineFullType.VIZ_Eng4)
{
conn.EndpointManager.Send($"{ApplicationDomainEx.VizPreviewRenderer} SET_KEY 1,RENDERER*KEY_INTERNAL*ACTIVE SET 0");
}
}
/// <summary>
/// 显示预览键
/// </summary>
/// <param name="conn">连接</param>
public void ShowKeyPreview(ConnModel conn)
{
if (conn == null)
throw new ArgumentNullException(nameof(conn));
VizConfigEntity config = ApplicationDomainEx.VizConfig;
if (config.EngineFullType == EngineFullType.VIZ_Eng3)
{
conn.EndpointManager.Send($"RENDERER SET_KEY 0,RENDERER*KEY_INTERNAL*IMAGE RESET,RENDERER*KEY_INTERNAL*ACTIVE SET 1");
}
else if (config.EngineFullType == EngineFullType.VIZ_Eng4)
{
conn.EndpointManager.Send($"{ApplicationDomainEx.VizPreviewRenderer} SET_KEY 0,RENDERER*KEY_INTERNAL*IMAGE RESET,RENDERER*KEY_INTERNAL*ACTIVE SET 1");
}
}
/// <summary>
/// 上版子
/// </summary>
/// <param name="connection">连接</param>
/// <param name="scene">场景</param>
/// <param name="layer">层</param>s
/// <param name="use_all_directors">使用所有控制器</param>
public void TakeIn(ConnModel conn, string scene, VizLayer layer, bool use_all_directors)
{
conn.EndpointManager.Send("RENDERER*UPDATE SET 0");
conn.EndpointManager.Send($"RENDERER*{layer} SET_OBJECT {scene}");
conn.EndpointManager.Send("RENDERER*UPDATE SET 1");
if (use_all_directors)
{
conn.EndpointManager.Send($"RENDERER*{layer}*STAGE START");
}
else
{
conn.EndpointManager.Send($"RENDERER*{layer}*STAGE START");
}
}
/// <summary>
/// 继续版子
/// </summary>
/// <param name="conn">连接</param>
/// <param name="layer">层</param>s
public void TakeContinue(ConnModel conn, VizLayer layer)
{
conn.EndpointManager.Send($"RENDERER*UPDATE SET 1");
conn.EndpointManager.Send($"RENDERER*{layer}*STAGE CONTINUE");
}
/// <summary>
/// 下版子
/// </summary>
/// <param name="connection">连接</param>
/// <param name="layer">层</param>s
public void TakeOut(ConnModel conn, VizLayer layer)
{
conn.EndpointManager.Send($"RENDERER*UPDATE SET 1");
conn.EndpointManager.Send($"RENDERER*{layer} SET_OBJECT");
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.14" targetFramework="net48" />
</packages>
\ No newline at end of file
using LiteDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Storage
{
/// <summary>
/// Viz配置实体
/// </summary>
public class VizConfigEntity
{
/// <summary>
/// 编号
/// </summary>
[BsonId(true)]
public int Id { get; set; }
/// <summary>
/// GH IP地址
/// </summary>
public string GH_IP { get; set; } = "localhost";
/// <summary>
/// GH 端口
/// </summary>
public int GH_Port { get; set; } = 19398;
/// <summary>
/// GH 服务名
/// </summary>
public string GH_ServerName { get; set; } = "VizDbServer";
/// <summary>
/// GH 用户名
/// </summary>
public string GH_UserName { get; set; } = "Admin";
/// <summary>
/// GH 密码
/// </summary>
public string GH_Password { get; set; } = "VizDb";
/// <summary>
/// VIZ_IP
/// </summary>
public string VIZ_IP { get; set; } = "localhost";
/// <summary>
/// VIZ 端口
/// </summary>
public int VIZ_Port { get; set; } = 6100;
/// <summary>
/// VIZ用户名
/// </summary>
public string VIZ_UserName { get; set; } = "Guest";
/// <summary>
/// VIZ密码
/// </summary>
public string VIZ_Password { get; set; }
/// <summary>
/// VIZ 引擎3路径
/// </summary>
public string VIZ_Eng3Path { get; set; } = @"D:\Program Files (x86)\Vizrt\Viz3\viz.exe";
/// <summary>
/// VIZ 引擎4路径
/// </summary>
public string VIZ_Eng4Path { get; set; } = @"D:\Program Files (x86)\Vizrt\Viz3\viz.exe";
/// <summary>
/// 引擎完整类型
/// </summary>
public EngineFullType EngineFullType { get; set; } = EngineFullType.VIZ_Eng4;
/// <summary>
/// 插件分组
/// </summary>
public string PluginGroup { get; set; }
}
}
using LiteDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Storage
{
/// <summary>
/// 连接实体
/// </summary>
public class ConnEntity
{
/// <summary>
/// 编号
/// </summary>
[BsonId(true)]
public int Id { get; set; }
/// <summary>
/// 连接ID
/// </summary>
public Guid ConnID { get; set; }
/// <summary>
/// 分组ID
/// </summary>
public Guid GroupID { get; set; }
/// <summary>
/// IP地址
/// </summary>
public string IP { get; set; }
/// <summary>
/// 端口
/// </summary>
public int Port { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 引擎类型
/// </summary>
public EngineType EngineType { get; set; }
/// <summary>
/// 是否启用
/// </summary>
public bool IsEnabled { get; set; }
}
}
using LiteDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Storage
{
/// <summary>
/// 连接分组实体
/// </summary>
public class ConnGroupEntity
{
/// <summary>
/// 编号
/// </summary>
[BsonId(true)]
public int Id { get; set; }
/// <summary>
/// 分组ID
/// </summary>
public Guid GroupID { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 是否启用
/// </summary>
public bool IsEnabled { get; set; }
}
}
using LiteDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Storage
{
/// <summary>
/// 页实体
/// </summary>
public class PageEntity : PageEntityBase
{
/// <summary>
/// 页ID
/// </summary>
public Guid PageID { get; set; }
/// <summary>
/// 所属页分组ID
/// </summary>
public Guid PageGroupID { get; set; }
/// <summary>
/// 模板ID
/// </summary>
public Guid TemplateID { get; set; }
/// <summary>
/// 关联插件ID
/// </summary>
public string PluginID { get; set; }
}
}
using LiteDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Storage
{
/// <summary>
/// 页实体基类
/// </summary>
public abstract class PageEntityBase
{
/// <summary>
/// 编号
/// </summary>
[BsonId(true)]
public int Id { get; set; }
/// <summary>
/// 场景
/// </summary>
public string Scene { get; set; }
/// <summary>
/// 场景路径
/// </summary>
public string ScenePath { get; set; }
/// <summary>
/// 缩略图地址
/// </summary>
public string ThumbnailUri { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 包装层
/// VIZ: <see cref="VizLayer"/>
/// </summary>
public string Layer { get; set; }
/// <summary>
/// 引擎类型
/// </summary>
public EngineType EngineType { get; set; }
}
}
using LiteDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Storage
{
/// <summary>
/// 页分组实体
/// </summary>
public class PageGroupEntity
{
/// <summary>
/// 分组编号
/// </summary>
public Guid GroupID { get; set; }
/// <summary>
/// 分组名称
/// </summary>
public string GroupName { get; set; }
}
}
using LiteDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Storage
{
/// <summary>
/// 页模板实体
/// </summary>
public class PageTemplateEntity : PageEntityBase
{
/// <summary>
/// 模板ID
/// </summary>
public Guid TemplateID { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VIZ.Package.Storage
{
/// <summary>
/// 引擎完整类型
/// </summary>
public enum EngineFullType
{
/// <summary>
/// VIZ3
/// </summary>
[Description("Viz引擎3")]
VIZ_Eng3,
/// <summary>
/// VIZ4
/// </summary>
[Description("Viz引擎4")]
VIZ_Eng4
}
}
This diff is collapsed. Click to expand it.
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