Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.Package
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘龙飞
VIZ.Package
Commits
f61fe3cb
Commit
f61fe3cb
authored
Apr 07, 2023
by
wangonghui
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into DevPackage
parents
c204fc03
fc973f23
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
79 deletions
+12
-79
VIZ.Package.Domain/Plugin/IPluginAssembly.cs
+0
-19
VIZ.Package.Domain/VIZ.Package.Domain.csproj
+0
-1
VIZ.Package.Module/PluginAssembly.cs
+0
-20
VIZ.Package.Module/VIZ.Package.Module.csproj
+0
-1
VIZ.Package.Service/Logic/Plugin/PluginService.cs
+12
-38
No files found.
VIZ.Package.Domain/Plugin/IPluginAssembly.cs
deleted
100644 → 0
View file @
c204fc03
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.Package.Domain
{
/// <summary>
/// 插件程序集
/// </summary>
public
interface
IPluginAssembly
{
/// <summary>
/// 监测
/// </summary>
void
Check
();
}
}
VIZ.Package.Domain/VIZ.Package.Domain.csproj
View file @
f61fe3cb
...
...
@@ -134,7 +134,6 @@
<Compile Include="Model\Scene\TransitionLogicSceneInfoModel.cs" />
<Compile Include="Model\Setting\SettingPageModel.cs" />
<Compile Include="Model\Task\PackageTaskModel.cs" />
<Compile Include="Plugin\IPluginAssembly.cs" />
<Compile Include="Plugin\IPluginLifeCycle.cs" />
<Compile Include="Plugin\IPluginSettingView.cs" />
<Compile Include="Plugin\IPluginView.cs" />
...
...
VIZ.Package.Module/PluginAssembly.cs
deleted
100644 → 0
View file @
c204fc03
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VIZ.Package.Domain
;
namespace
VIZ.Package.Module
{
/// <summary>
/// 插件程序集
/// </summary>
public
class
PluginAssembly
:
IPluginAssembly
{
public
void
Check
()
{
}
}
}
VIZ.Package.Module/VIZ.Package.Module.csproj
View file @
f61fe3cb
...
...
@@ -179,7 +179,6 @@
<Compile Include="Page\Group\Widgets\PageNumberEdit.xaml.cs">
<DependentUpon>PageNumberEdit.xaml</DependentUpon>
</Compile>
<Compile Include="PluginAssembly.cs" />
<Compile Include="Plugin\Model\PluginNavigationConfig.cs" />
<Compile Include="Plugin\Service\IPluginService.cs" />
<Compile Include="Preview\VizPreview\Controller\VizPreviewCmdController.cs" />
...
...
VIZ.Package.Service/Logic/Plugin/PluginService.cs
View file @
f61fe3cb
...
...
@@ -41,7 +41,6 @@ namespace VIZ.Package.Service
string
[]
files
=
System
.
IO
.
Directory
.
GetFiles
(
AppDomain
.
CurrentDomain
.
BaseDirectory
);
Type
pluginLifeCycleType
=
typeof
(
IPluginLifeCycle
);
Type
pluginAssemblyType
=
typeof
(
IPluginAssembly
);
foreach
(
string
file
in
files
)
{
...
...
@@ -51,45 +50,10 @@ namespace VIZ.Package.Service
continue
;
Assembly
assembly
=
Assembly
.
LoadFile
(
file
);
string
version
=
assembly
.
GetCustomAttribute
<
AssemblyVersionAttribute
>()?.
Version
;
Type
[]
types
=
assembly
.
GetTypes
();
// 是否通过检测
bool
checkPass
=
false
;
foreach
(
Type
type
in
types
)
{
if
(!
type
.
IsClass
)
continue
;
if
(!
pluginAssemblyType
.
IsAssignableFrom
(
type
))
continue
;
IPluginAssembly
pluginAssembly
=
type
.
Assembly
.
CreateInstance
(
type
.
FullName
)
as
IPluginAssembly
;
if
(
pluginAssembly
==
null
)
{
log
.
Error
(
$"check plugin assembly type:
{
type
.
FullName
}
error."
);
continue
;
}
try
{
pluginAssembly
.
Check
();
checkPass
=
true
;
break
;
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
break
;
}
}
// 检测未通过
if
(!
checkPass
)
continue
;
// 检测通过
foreach
(
Type
type
in
types
)
{
if
(!
type
.
IsClass
)
...
...
@@ -112,7 +76,17 @@ namespace VIZ.Package.Service
if
(!
string
.
Equals
(
entry_attribute
.
Key
,
attribute
.
Key
))
continue
;
PluginInfo
info
=
lifeCycle
.
Register
();
PluginInfo
info
=
null
;
try
{
info
=
lifeCycle
.
Register
();
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
break
;
}
list
.
Add
(
info
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment