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
da028ffb
Commit
da028ffb
authored
Feb 24, 2023
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
快捷键
parent
eb2e1563
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
399 additions
and
5 deletions
+399
-5
VIZ.Package.Domain/Message/Hotkey/HotkeyMessage.cs
+25
-0
VIZ.Package.Domain/Plugin/PluginInfo.cs
+15
-0
VIZ.Package.Domain/VIZ.Package.Domain.csproj
+1
-0
VIZ.Package.Module/Control/ViewModel/ControlViewModel.cs
+57
-0
VIZ.Package.Module/ControlObject/FieldEdit/ViewModel/FieldEditViewModel.cs
+22
-0
VIZ.Package.Module/Main/Controller/HotkeyController.cs
+88
-0
VIZ.Package.Module/Main/ViewModel/MainTopViewModel.cs
+27
-0
VIZ.Package.Module/Main/ViewModel/MainViewModel.cs
+55
-1
VIZ.Package.Module/Page/Group/ViewModel/PageGroupViewModel.cs
+60
-0
VIZ.Package.Module/Page/Templage/ViewModel/PageTemplateViewModel.cs
+31
-1
VIZ.Package.Module/Preview/VizPreview/Controller/VizPreviewController.cs
+1
-1
VIZ.Package.Module/VIZ.Package.Module.csproj
+1
-1
VIZ.Package.Plugin/Control/PluginLoader.cs
+7
-0
VIZ.Package.Plugin/VIZ.Package.Plugin.csproj
+8
-0
VIZ.Package.sln
+1
-1
No files found.
VIZ.Package.Domain/Message/Hotkey/HotkeyMessage.cs
0 → 100644
View file @
da028ffb
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
namespace
VIZ.Package.Domain
{
/// <summary>
/// 热键消息
/// </summary>
public
class
HotkeyMessage
{
/// <summary>
/// 热键
/// </summary>
public
string
Key
{
get
;
set
;
}
/// <summary>
/// 当前激活的视图
/// </summary>
public
FrameworkElement
View
{
get
;
set
;
}
}
}
VIZ.Package.Domain/Plugin/PluginInfo.cs
View file @
da028ffb
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
VIZ.Framework.Core
;
using
VIZ.Framework.Core
;
using
VIZ.Package.Storage
;
using
VIZ.Package.Storage
;
...
@@ -125,6 +126,20 @@ namespace VIZ.Package.Domain
...
@@ -125,6 +126,20 @@ namespace VIZ.Package.Domain
#
endregion
#
endregion
#
region
View
--
视图
private
WeakReference
<
FrameworkElement
>
view
;
/// <summary>
/// 视图
/// </summary>
public
WeakReference
<
FrameworkElement
>
View
{
get
{
return
view
;
}
set
{
view
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
View
));
}
}
#
endregion
/// <summary>
/// <summary>
/// 空插件
/// 空插件
/// </summary>
/// </summary>
...
...
VIZ.Package.Domain/VIZ.Package.Domain.csproj
View file @
da028ffb
...
@@ -87,6 +87,7 @@
...
@@ -87,6 +87,7 @@
<Compile Include="Message\Conn\ConnChangedMessage.cs" />
<Compile Include="Message\Conn\ConnChangedMessage.cs" />
<Compile Include="Message\ControlObject\ControlListFieldChangedMessage.cs" />
<Compile Include="Message\ControlObject\ControlListFieldChangedMessage.cs" />
<Compile Include="Message\ControlObject\ControlFieldChangedMessage.cs" />
<Compile Include="Message\ControlObject\ControlFieldChangedMessage.cs" />
<Compile Include="Message\Hotkey\HotkeyMessage.cs" />
<Compile Include="Message\Log\ErrorLogMessage.cs" />
<Compile Include="Message\Log\ErrorLogMessage.cs" />
<Compile Include="Message\Log\VizCommandLogMessage.cs" />
<Compile Include="Message\Log\VizCommandLogMessage.cs" />
<Compile Include="Message\Page\PageDeleteMessage.cs" />
<Compile Include="Message\Page\PageDeleteMessage.cs" />
...
...
VIZ.Package.Module/Control/ViewModel/ControlViewModel.cs
View file @
da028ffb
...
@@ -27,6 +27,9 @@ namespace VIZ.Package.Module
...
@@ -27,6 +27,9 @@ namespace VIZ.Package.Module
// 初始化命令
// 初始化命令
this
.
InitCommand
();
this
.
InitCommand
();
// 初始化消息
this
.
InitMessage
();
// 注册服务
// 注册服务
ApplicationDomainEx
.
ServiceManager
.
AddService
(
ViewServiceKeys
.
CONTROL_SERVICE
,
this
);
ApplicationDomainEx
.
ServiceManager
.
AddService
(
ViewServiceKeys
.
CONTROL_SERVICE
,
this
);
}
}
...
@@ -42,6 +45,14 @@ namespace VIZ.Package.Module
...
@@ -42,6 +45,14 @@ namespace VIZ.Package.Module
this
.
UpdateCommand
=
new
VCommand
(
this
.
Update
);
this
.
UpdateCommand
=
new
VCommand
(
this
.
Update
);
}
}
/// <summary>
/// 初始化消息
/// </summary>
private
void
InitMessage
()
{
ApplicationDomainEx
.
MessageManager
.
Register
<
HotkeyMessage
>(
this
,
this
.
OnHotkeyMessage
);
}
// ==============================================================
// ==============================================================
// Service & Controller
// Service & Controller
// ==============================================================
// ==============================================================
...
@@ -182,6 +193,52 @@ namespace VIZ.Package.Module
...
@@ -182,6 +193,52 @@ namespace VIZ.Package.Module
#
endregion
#
endregion
// ==============================================================
// ==============================================================
// Message
// ==============================================================
/// <summary>
/// 处理热键消息
/// </summary>
/// <param name="msg">消息</param>
private
void
OnHotkeyMessage
(
HotkeyMessage
msg
)
{
try
{
// 上板
if
(
string
.
Equals
(
msg
.
Key
,
ApplicationDomainEx
.
HotKeyConfig
.
Take
))
{
this
.
Take
();
return
;
}
// 继续
if
(
string
.
Equals
(
msg
.
Key
,
ApplicationDomainEx
.
HotKeyConfig
.
TakeContinue
))
{
this
.
Continue
();
return
;
}
// 下版
if
(
string
.
Equals
(
msg
.
Key
,
ApplicationDomainEx
.
HotKeyConfig
.
TakeOut
))
{
this
.
TakeOut
();
return
;
}
// 更新
if
(
string
.
Equals
(
msg
.
Key
,
ApplicationDomainEx
.
HotKeyConfig
.
TakeUpdate
))
{
this
.
Update
();
return
;
}
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
}
}
// ==============================================================
// Private Function
// Private Function
// ==============================================================
// ==============================================================
...
...
VIZ.Package.Module/ControlObject/FieldEdit/ViewModel/FieldEditViewModel.cs
View file @
da028ffb
...
@@ -51,6 +51,7 @@ namespace VIZ.Package.Module
...
@@ -51,6 +51,7 @@ namespace VIZ.Package.Module
/// </summary>
/// </summary>
private
void
InitMessage
()
private
void
InitMessage
()
{
{
ApplicationDomainEx
.
MessageManager
.
Register
<
HotkeyMessage
>(
this
,
this
.
OnHotkeyMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ControlFieldChangedMessage
>(
this
,
this
.
OnControlFieldChangedMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ControlFieldChangedMessage
>(
this
,
this
.
OnControlFieldChangedMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
PageOpenMessage
>(
this
,
this
.
OnPageOpenMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
PageOpenMessage
>(
this
,
this
.
OnPageOpenMessage
);
}
}
...
@@ -292,6 +293,27 @@ namespace VIZ.Package.Module
...
@@ -292,6 +293,27 @@ namespace VIZ.Package.Module
this
.
SelectedNavigationConfig
=
config
;
this
.
SelectedNavigationConfig
=
config
;
}
}
/// <summary>
/// 热键消息
/// </summary>
/// <param name="msg">消息</param>
private
void
OnHotkeyMessage
(
HotkeyMessage
msg
)
{
try
{
// 保存
if
(
string
.
Equals
(
msg
.
Key
,
ApplicationDomainEx
.
HotKeyConfig
.
SaveOpendPageOrTemplateAndProject
))
{
this
.
Save
();
return
;
}
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
}
}
// =============================================================
// =============================================================
// Public Function
// Public Function
// =============================================================
// =============================================================
...
...
VIZ.Package.Module/Main/Controller/HotkeyController.cs
0 → 100644
View file @
da028ffb
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
VIZ.Framework.Core
;
using
VIZ.Package.Domain
;
using
VIZ.Package.Plugin
;
namespace
VIZ.Package.Module
{
/// <summary>
/// 热键控制器
/// </summary>
public
class
HotkeyController
{
/// <summary>
/// 热键控制器
/// </summary>
/// <param name="vm">视图模型</param>
public
HotkeyController
(
MainViewModel
vm
)
{
this
.
MainViewModel
=
vm
;
}
/// <summary>
/// 主视图模型
/// </summary>
public
MainViewModel
MainViewModel
{
get
;
set
;
}
/// <summary>
/// 开始执行热键
/// </summary>
/// <param name="key">热键</param>
public
void
BeginExecute
(
string
key
)
{
if
(
string
.
IsNullOrWhiteSpace
(
key
))
return
;
WPFHelper
.
BeginInvoke
(()
=>
{
// 主视图未打开时不处理快捷键
if
(!
ApplicationDomainEx
.
MainWindow
.
IsActive
)
return
;
// 插件视图
FrameworkElement
pluginView
=
this
.
GetPluginView
();
HotkeyMessage
msg
=
new
HotkeyMessage
();
msg
.
Key
=
key
;
msg
.
View
=
pluginView
;
ApplicationDomainEx
.
MessageManager
.
Send
(
msg
);
if
(!
ApplicationDomainEx
.
IS_DEBUG
)
return
;
Debug
.
WriteLine
(
$"Hotkey:
{
key
}
, View:
{
pluginView
?.
ToString
()}
"
);
});
}
/// <summary>
/// 获取插件视图
/// </summary>
/// <returns>插件视图</returns>
private
FrameworkElement
GetPluginView
()
{
MainView
view
=
this
.
MainViewModel
.
GetView
<
MainView
>();
if
(
view
==
null
)
return
null
;
FrameworkElement
element
=
view
.
dockLayoutManager
.
ActiveDockItem
as
FrameworkElement
;
if
(
element
==
null
)
return
null
;
PluginInfo
info
=
element
.
DataContext
as
PluginInfo
;
if
(
info
==
null
)
return
null
;
FrameworkElement
pluginView
=
null
;
info
.
View
?.
TryGetTarget
(
out
pluginView
);
return
pluginView
;
}
}
}
VIZ.Package.Module/Main/ViewModel/MainTopViewModel.cs
View file @
da028ffb
using
DevExpress.Xpf.Bars
;
using
DevExpress.Xpf.Bars
;
using
DevExpress.Xpf.Core
;
using
DevExpress.Xpf.Core
;
using
log4net
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
System.Collections.ObjectModel
;
...
@@ -20,6 +21,11 @@ namespace VIZ.Package.Module
...
@@ -20,6 +21,11 @@ namespace VIZ.Package.Module
/// </summary>
/// </summary>
public
class
MainTopViewModel
:
ViewModelBase
public
class
MainTopViewModel
:
ViewModelBase
{
{
/// <summary>
/// 日志
/// </summary>
private
readonly
static
ILog
log
=
LogManager
.
GetLogger
(
typeof
(
MainTopViewModel
));
public
MainTopViewModel
()
public
MainTopViewModel
()
{
{
// 初始化命令
// 初始化命令
...
@@ -52,6 +58,7 @@ namespace VIZ.Package.Module
...
@@ -52,6 +58,7 @@ namespace VIZ.Package.Module
/// </summary>
/// </summary>
private
void
InitMessage
()
private
void
InitMessage
()
{
{
ApplicationDomainEx
.
MessageManager
.
Register
<
HotkeyMessage
>(
this
,
this
.
OnHotkeyMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
VizPreviewReadyMessage
>(
this
,
this
.
OnVizPreviewReadyMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
VizPreviewReadyMessage
>(
this
,
this
.
OnVizPreviewReadyMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
VizPreviewRestartMessage
>(
this
,
this
.
OnVizPreviewRestartMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
VizPreviewRestartMessage
>(
this
,
this
.
OnVizPreviewRestartMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ApplicationClosingMessage
>(
this
,
this
.
OnApplicationClosingMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ApplicationClosingMessage
>(
this
,
this
.
OnApplicationClosingMessage
);
...
@@ -482,6 +489,26 @@ namespace VIZ.Package.Module
...
@@ -482,6 +489,26 @@ namespace VIZ.Package.Module
}
}
}
}
/// <summary>
/// 热键消息
/// </summary>
/// <param name="msg">消息</param>
private
void
OnHotkeyMessage
(
HotkeyMessage
msg
)
{
try
{
if
(
string
.
Equals
(
msg
.
Key
,
ApplicationDomainEx
.
HotKeyConfig
.
SaveOpendPageOrTemplateAndProject
))
{
this
.
SaveProject
();
return
;
}
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
}
}
// =====================================================================
// =====================================================================
// Public Function
// Public Function
// =====================================================================
// =====================================================================
...
...
VIZ.Package.Module/Main/ViewModel/MainViewModel.cs
View file @
da028ffb
using
System
;
using
Gma.System.MouseKeyHook
;
using
log4net
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
System.Collections.ObjectModel
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
VIZ.Framework.Common
;
using
VIZ.Framework.Core
;
using
VIZ.Framework.Core
;
using
VIZ.Package.Domain
;
using
VIZ.Package.Domain
;
using
VIZ.Package.Plugin
;
using
VIZ.Package.Plugin
;
...
@@ -16,6 +19,11 @@ namespace VIZ.Package.Module
...
@@ -16,6 +19,11 @@ namespace VIZ.Package.Module
/// </summary>
/// </summary>
public
class
MainViewModel
:
ViewModelBase
,
IMainViewService
public
class
MainViewModel
:
ViewModelBase
,
IMainViewService
{
{
/// <summary>
/// 日志
/// </summary>
private
readonly
static
ILog
log
=
LogManager
.
GetLogger
(
typeof
(
MainViewModel
));
public
MainViewModel
()
public
MainViewModel
()
{
{
// 初始化命令
// 初始化命令
...
@@ -24,6 +32,9 @@ namespace VIZ.Package.Module
...
@@ -24,6 +32,9 @@ namespace VIZ.Package.Module
// 初始化消息
// 初始化消息
this
.
InitMessage
();
this
.
InitMessage
();
// 初始化控制器
this
.
InitController
();
// 初始化热键
// 初始化热键
this
.
InitHotkey
();
this
.
InitHotkey
();
...
@@ -48,17 +59,43 @@ namespace VIZ.Package.Module
...
@@ -48,17 +59,43 @@ namespace VIZ.Package.Module
}
}
/// <summary>
/// <summary>
/// 初始化控制器
/// </summary>
private
void
InitController
()
{
this
.
HotkeyController
=
new
HotkeyController
(
this
);
}
/// <summary>
/// 初始化热键
/// 初始化热键
/// </summary>
/// </summary>
private
void
InitHotkey
()
private
void
InitHotkey
()
{
{
// 注册键盘钩子
this
.
KeyboardMouseEvents
=
Hook
.
GlobalEvents
();
this
.
KeyboardMouseEvents
.
KeyDown
-=
KeyboardMouseEvents_KeyDown
;
this
.
KeyboardMouseEvents
.
KeyDown
+=
KeyboardMouseEvents_KeyDown
;
}
}
// ============================================================
// ============================================================
// Field
// ============================================================
/// <summary>
/// 鼠标键盘钩子
/// </summary>
private
IKeyboardMouseEvents
KeyboardMouseEvents
;
// ============================================================
// Service & Controller
// Service & Controller
// ============================================================
// ============================================================
/// <summary>
/// 热键控制器
/// </summary>
private
HotkeyController
HotkeyController
;
// ============================================================
// ============================================================
// Property
// Property
// ============================================================
// ============================================================
...
@@ -254,5 +291,22 @@ namespace VIZ.Package.Module
...
@@ -254,5 +291,22 @@ namespace VIZ.Package.Module
return
path
;
return
path
;
}
}
/// <summary>
/// 键盘钩子事件
/// </summary>
private
void
KeyboardMouseEvents_KeyDown
(
object
sender
,
System
.
Windows
.
Forms
.
KeyEventArgs
e
)
{
try
{
string
key
=
HotkeyHelper
.
GetHotkey
(
e
);
this
.
HotkeyController
.
BeginExecute
(
key
);
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
}
}
}
}
}
}
VIZ.Package.Module/Page/Group/ViewModel/PageGroupViewModel.cs
View file @
da028ffb
...
@@ -109,6 +109,7 @@ namespace VIZ.Package.Module
...
@@ -109,6 +109,7 @@ namespace VIZ.Package.Module
/// </summary>
/// </summary>
private
void
InitMessage
()
private
void
InitMessage
()
{
{
ApplicationDomainEx
.
MessageManager
.
Register
<
HotkeyMessage
>(
this
,
this
.
OnHotkeyMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectOpenMessage
>(
this
,
this
.
OnProjectOpenMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectOpenMessage
>(
this
,
this
.
OnProjectOpenMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectCloseMessage
>(
this
,
this
.
OnProjectCloseMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectCloseMessage
>(
this
,
this
.
OnProjectCloseMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectSaveMessage
>(
this
,
this
.
OnProjectSaveMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectSaveMessage
>(
this
,
this
.
OnProjectSaveMessage
);
...
@@ -819,6 +820,38 @@ namespace VIZ.Package.Module
...
@@ -819,6 +820,38 @@ namespace VIZ.Package.Module
}
}
}
}
/// <summary>
/// 处理热键消息
/// </summary>
/// <param name="msg">消息</param>
private
void
OnHotkeyMessage
(
HotkeyMessage
msg
)
{
try
{
// 打开下一页
if
(
string
.
Equals
(
msg
.
Key
,
ApplicationDomainEx
.
HotKeyConfig
.
OpenNextPage
))
{
this
.
OpenNextPageItem
();
return
;
}
// 只有当前激活视图为节目单视图时处理
PageGroupView
view
=
this
.
GetView
<
PageGroupView
>();
if
(
view
==
null
||
msg
.
View
!=
view
)
return
;
// 删除页
if
(
string
.
Equals
(
msg
.
Key
,
ApplicationDomainEx
.
HotKeyConfig
.
DeletePageOrTemplate
))
{
this
.
DeleteItem
();
}
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
}
}
// ======================================================================================
// ======================================================================================
// Public Function
// Public Function
// ======================================================================================
// ======================================================================================
...
@@ -929,6 +962,33 @@ namespace VIZ.Package.Module
...
@@ -929,6 +962,33 @@ namespace VIZ.Package.Module
this
.
ConnGroups
=
ApplicationDomainEx
.
ConnGroups
;
this
.
ConnGroups
=
ApplicationDomainEx
.
ConnGroups
;
}
}
/// <summary>
/// 打开下一页
/// </summary>
public
void
OpenNextPageItem
()
{
if
(
this
.
SelectedPageGroupModel
==
null
)
return
;
PageModel
page
=
ApplicationDomainEx
.
CurrentPage
as
PageModel
;
if
(
page
==
null
)
return
;
if
(
this
.
SelectedPageGroupModel
.
Pages
==
null
||
this
.
SelectedPageGroupModel
.
Pages
.
Count
==
0
)
return
;
int
index
=
this
.
SelectedPageGroupModel
.
Pages
.
IndexOf
(
page
);
if
(
index
<
0
)
return
;
++
index
;
if
(
index
<
this
.
SelectedPageGroupModel
.
Pages
.
Count
)
{
this
.
SelectedPageGroupModel
.
SelectedPage
=
this
.
SelectedPageGroupModel
.
Pages
[
index
];
this
.
OpenPage
();
}
}
// ======================================================================================
// ======================================================================================
// Private Function
// Private Function
// ======================================================================================
// ======================================================================================
...
...
VIZ.Package.Module/Page/Templage/ViewModel/PageTemplateViewModel.cs
View file @
da028ffb
...
@@ -8,7 +8,9 @@ using System.Linq;
...
@@ -8,7 +8,9 @@ using System.Linq;
using
System.Text
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
System.Web.UI
;
using
System.Web.UI
;
using
System.Windows
;
using
System.Windows.Controls.Primitives
;
using
System.Windows.Controls.Primitives
;
using
System.Windows.Media.Animation
;
using
VIZ.Framework.Core
;
using
VIZ.Framework.Core
;
using
VIZ.Package.Domain
;
using
VIZ.Package.Domain
;
using
VIZ.Package.Service
;
using
VIZ.Package.Service
;
...
@@ -54,6 +56,7 @@ namespace VIZ.Package.Module
...
@@ -54,6 +56,7 @@ namespace VIZ.Package.Module
/// </summary>
/// </summary>
private
void
InitMessage
()
private
void
InitMessage
()
{
{
ApplicationDomainEx
.
MessageManager
.
Register
<
HotkeyMessage
>(
this
,
this
.
OnHotkeyMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectOpenMessage
>(
this
,
this
.
OnProjectOpenMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectOpenMessage
>(
this
,
this
.
OnProjectOpenMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectCloseMessage
>(
this
,
this
.
OnProjectCloseMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectCloseMessage
>(
this
,
this
.
OnProjectCloseMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectSaveMessage
>(
this
,
this
.
OnProjectSaveMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectSaveMessage
>(
this
,
this
.
OnProjectSaveMessage
);
...
@@ -290,7 +293,8 @@ namespace VIZ.Package.Module
...
@@ -290,7 +293,8 @@ namespace VIZ.Package.Module
if
(
this
.
SelectedSceneTemplateModels
==
null
||
this
.
SelectedSceneTemplateModels
.
Count
==
0
)
if
(
this
.
SelectedSceneTemplateModels
==
null
||
this
.
SelectedSceneTemplateModels
.
Count
==
0
)
return
;
return
;
if
(
DXMessageBox
.
Show
(
$"是否删除模板?"
,
"提示"
,
System
.
Windows
.
MessageBoxButton
.
YesNo
)
!=
System
.
Windows
.
MessageBoxResult
.
Yes
)
string
scenes
=
string
.
Join
(
" ,"
,
this
.
SelectedSceneTemplateModels
.
Select
(
p
=>
p
.
Scene
));
if
(
DXMessageBox
.
Show
(
$"是否删除模板 [
{
scenes
}
] ?"
,
"提示"
,
MessageBoxButton
.
YesNo
)
!=
MessageBoxResult
.
Yes
)
return
;
return
;
List
<
PageTemplateModel
>
templates
=
this
.
SelectedSceneTemplateModels
.
ToList
();
List
<
PageTemplateModel
>
templates
=
this
.
SelectedSceneTemplateModels
.
ToList
();
...
@@ -354,6 +358,32 @@ namespace VIZ.Package.Module
...
@@ -354,6 +358,32 @@ namespace VIZ.Package.Module
this
.
pageService
.
SavePageTemplates
(
this
.
SceneTemplateModels
);
this
.
pageService
.
SavePageTemplates
(
this
.
SceneTemplateModels
);
}
}
/// <summary>
/// 处理热键消息
/// </summary>
/// <param name="msg">消息</param>
private
void
OnHotkeyMessage
(
HotkeyMessage
msg
)
{
try
{
// 只有当前激活视图是模板页时处理
PageTemplateView
view
=
this
.
GetView
<
PageTemplateView
>();
if
(
msg
.
View
==
null
||
msg
.
View
!=
view
)
return
;
// 删除
if
(
string
.
Equals
(
msg
.
Key
,
ApplicationDomainEx
.
HotKeyConfig
.
DeletePageOrTemplate
))
{
this
.
Delete
();
return
;
}
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
}
}
// ======================================================================================
// ======================================================================================
// Public Function
// Public Function
// ======================================================================================
// ======================================================================================
...
...
VIZ.Package.Module/Preview/VizPreview/Controller/VizPreviewController.cs
View file @
da028ffb
...
@@ -154,7 +154,7 @@ namespace VIZ.Package.Module
...
@@ -154,7 +154,7 @@ namespace VIZ.Package.Module
/// <summary>
/// <summary>
/// 发送Viz引擎准备完毕消息
/// 发送Viz引擎准备完毕消息
/// </summary>
/// </summary>
p
ublic
void
BeginSendVizEngineReadlyMessage
()
p
rivate
void
BeginSendVizEngineReadlyMessage
()
{
{
WPFHelper
.
BeginInvoke
(()
=>
WPFHelper
.
BeginInvoke
(()
=>
{
{
...
...
VIZ.Package.Module/VIZ.Package.Module.csproj
View file @
da028ffb
...
@@ -129,6 +129,7 @@
...
@@ -129,6 +129,7 @@
<Compile Include="ControlObject\FieldEdit\ViewModel\FieldEditViewModelBase.cs" />
<Compile Include="ControlObject\FieldEdit\ViewModel\FieldEditViewModelBase.cs" />
<Compile Include="ControlObject\FieldTree\Service\IFieldTreeService.cs" />
<Compile Include="ControlObject\FieldTree\Service\IFieldTreeService.cs" />
<Compile Include="Log\ViewModel\VizCommandWindowModel.cs" />
<Compile Include="Log\ViewModel\VizCommandWindowModel.cs" />
<Compile Include="Main\Controller\HotkeyController.cs" />
<Compile Include="Page\Core\View\PageLoadingWindow.xaml.cs">
<Compile Include="Page\Core\View\PageLoadingWindow.xaml.cs">
<DependentUpon>PageLoadingWindow.xaml</DependentUpon>
<DependentUpon>PageLoadingWindow.xaml</DependentUpon>
</Compile>
</Compile>
...
@@ -407,7 +408,6 @@
...
@@ -407,7 +408,6 @@
</None>
</None>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Folder Include="Main\Controller\" />
<Folder Include="ProjectManager\Model\" />
<Folder Include="ProjectManager\Model\" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
...
...
VIZ.Package.Plugin/Control/PluginLoader.cs
View file @
da028ffb
...
@@ -6,6 +6,7 @@ using System.Text;
...
@@ -6,6 +6,7 @@ using System.Text;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
System.Windows
;
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Controls
;
using
VIZ.Package.Domain
;
namespace
VIZ.Package.Plugin
namespace
VIZ.Package.Plugin
{
{
...
@@ -63,6 +64,12 @@ namespace VIZ.Package.Plugin
...
@@ -63,6 +64,12 @@ namespace VIZ.Package.Plugin
FrameworkElement
view
=
this
.
ViewType
.
Assembly
.
CreateInstance
(
this
.
ViewType
.
FullName
)
as
FrameworkElement
;
FrameworkElement
view
=
this
.
ViewType
.
Assembly
.
CreateInstance
(
this
.
ViewType
.
FullName
)
as
FrameworkElement
;
this
.
Content
=
view
;
this
.
Content
=
view
;
PluginInfo
info
=
this
.
DataContext
as
PluginInfo
;
if
(
info
!=
null
)
{
info
.
View
=
new
WeakReference
<
FrameworkElement
>(
view
);
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
...
VIZ.Package.Plugin/VIZ.Package.Plugin.csproj
View file @
da028ffb
...
@@ -111,10 +111,18 @@
...
@@ -111,10 +111,18 @@
<Project>{75b39591-4bc3-4b09-bd7d-ec9f67efa96e}</Project>
<Project>{75b39591-4bc3-4b09-bd7d-ec9f67efa96e}</Project>
<Name>VIZ.Framework.Core</Name>
<Name>VIZ.Framework.Core</Name>
</ProjectReference>
</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">
<ProjectReference Include="..\..\VIZ.Framework\VIZ.Framework.Storage\VIZ.Framework.Storage.csproj">
<Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project>
<Project>{06b80c09-343d-4bb2-aeb1-61cfbfbf5cad}</Project>
<Name>VIZ.Framework.Storage</Name>
<Name>VIZ.Framework.Storage</Name>
</ProjectReference>
</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">
<ProjectReference Include="..\VIZ.Package.Storage\VIZ.Package.Storage.csproj">
<Project>{5bf08a07-9405-4f5d-a7f7-9d9ee17d6dd0}</Project>
<Project>{5bf08a07-9405-4f5d-a7f7-9d9ee17d6dd0}</Project>
<Name>VIZ.Package.Storage</Name>
<Name>VIZ.Package.Storage</Name>
...
...
VIZ.Package.sln
View file @
da028ffb
...
@@ -14,7 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "10-Core", "10-Core", "{38A2
...
@@ -14,7 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "10-Core", "10-Core", "{38A2
EndProject
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "20-Storage", "20-Storage", "{DA43E9E0-AFD0-4764-8228-44A01DF922A3}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "20-Storage", "20-Storage", "{DA43E9E0-AFD0-4764-8228-44A01DF922A3}"
EndProject
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "
25-Plugin", "2
5-Plugin", "{9AA1CFFD-41A1-448C-9144-1115A6B19AFA}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "
45-Plugin", "4
5-Plugin", "{9AA1CFFD-41A1-448C-9144-1115A6B19AFA}"
EndProject
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "30-Domain", "30-Domain", "{7E1F0C7E-1A9C-4E9E-AB5F-C38BBB1B3E4A}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "30-Domain", "30-Domain", "{7E1F0C7E-1A9C-4E9E-AB5F-C38BBB1B3E4A}"
EndProject
EndProject
...
...
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