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
c204fc03
Commit
c204fc03
authored
Apr 07, 2023
by
wangonghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
暂时提交
parent
196f206a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
101 additions
and
1 deletions
+101
-1
VIZ.Package.Module/Main/Service/IMainViewService.cs
+10
-0
VIZ.Package.Module/Main/ViewModel/MainTopViewModel.cs
+61
-0
VIZ.Package.Module/Main/ViewModel/MainViewModel.cs
+30
-1
No files found.
VIZ.Package.Module/Main/Service/IMainViewService.cs
View file @
c204fc03
...
...
@@ -27,5 +27,15 @@ namespace VIZ.Package.Module
/// </summary>
/// <param name="isEnabled">是否可用</param>
void
SetIsEnabled
(
bool
isEnabled
);
/// <summary>
/// 保存位置
/// </summary>
void
SaveLayout1
();
/// <summary>
/// 加载位置
/// </summary>
void
LoadLayout1
();
}
}
VIZ.Package.Module/Main/ViewModel/MainTopViewModel.cs
View file @
c204fc03
...
...
@@ -54,6 +54,10 @@ namespace VIZ.Package.Module
this
.
AboutCommand
=
new
VCommand
(
this
.
About
);
this
.
AboutCustomControlFieldCommand
=
new
VCommand
(
this
.
AboutCustomControlField
);
this
.
AboutPageCommandCommand
=
new
VCommand
(
this
.
AboutPageCommand
);
this
.
ExportLayoutCommand
=
new
VCommand
(
this
.
ExportLayout
);
this
.
ImportLayoutCommand
=
new
VCommand
(
this
.
ImportLayout
);
}
/// <summary>
...
...
@@ -167,6 +171,21 @@ namespace VIZ.Package.Module
Command
=
this
.
ResetLayoutCommand
});
items
.
Add
(
new
MenuItemModel
{
Header
=
"导入布局"
,
Icon
=
"/VIZ.Package.Module.Resource;component/Icons/top_icon_layout_20x20.png"
,
Type
=
MenuItemType
.
Button
,
Command
=
this
.
ExportLayoutCommand
});
items
.
Add
(
new
MenuItemModel
{
Header
=
"导出布局"
,
Icon
=
"/VIZ.Package.Module.Resource;component/Icons/top_icon_layout_20x20.png"
,
Type
=
MenuItemType
.
Button
,
Command
=
this
.
ImportLayoutCommand
});
this
.
ItemsSource
=
items
.
ToObservableCollection
();
}
...
...
@@ -428,6 +447,48 @@ namespace VIZ.Package.Module
#
endregion
#
region
ImportLayoutCommand
--
导入布局
public
VCommand
ImportLayoutCommand
{
get
;
set
;
}
private
void
ImportLayout
()
{
IMainViewService
service
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IMainViewService
>(
ViewServiceKeys
.
MAIN_VIEW_SERVICE
);
if
(
service
==
null
)
return
;
// 记录操作日志
this
.
recordLogService
.
AppendLog
(
ApplicationConstants
.
APPLICATION_GROUP_NAME
,
RecordLogOperate
.
Operate
,
RecordLogTrigger
.
Human
,
"导入布局"
);
service
.
LoadLayout1
();
}
#
endregion
#
region
ExportLayoutCommand
---
导出布局
public
VCommand
ExportLayoutCommand
{
get
;
set
;
}
private
void
ExportLayout
()
{
IMainViewService
service
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IMainViewService
>(
ViewServiceKeys
.
MAIN_VIEW_SERVICE
);
if
(
service
==
null
)
return
;
// 记录操作日志
this
.
recordLogService
.
AppendLog
(
ApplicationConstants
.
APPLICATION_GROUP_NAME
,
RecordLogOperate
.
Operate
,
RecordLogTrigger
.
Human
,
"导出布局"
);
service
.
SaveLayout1
();
}
#
endregion
#
region
AboutCommand
--
关于命令
/// <summary>
...
...
VIZ.Package.Module/Main/ViewModel/MainViewModel.cs
View file @
c204fc03
using
Gma.System.MouseKeyHook
;
using
DevExpress.Xpf.Docking
;
using
Gma.System.MouseKeyHook
;
using
log4net
;
using
Microsoft.Win32
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
...
...
@@ -309,5 +311,32 @@ namespace VIZ.Package.Module
}
}
const
string
filter
=
"Configuration (*.xml)|*.xml|All files (*.*)|*.*"
;
public
void
SaveLayout1
()
{
MainView
view
=
this
.
GetView
<
MainView
>();
if
(
view
==
null
)
return
;
OpenFileDialog
openFileDialog
=
new
OpenFileDialog
()
{
Filter
=
filter
};
var
openResult
=
openFileDialog
.
ShowDialog
();
if
(
openResult
.
HasValue
&&
openResult
.
Value
)
view
.
dockLayoutManager
.
RestoreLayoutFromXml
(
openFileDialog
.
FileName
);
}
public
void
LoadLayout1
()
{
MainView
view
=
this
.
GetView
<
MainView
>();
if
(
view
==
null
)
return
;
SaveFileDialog
saveFileDialog
=
new
SaveFileDialog
()
{
Filter
=
filter
};
var
saveResult
=
saveFileDialog
.
ShowDialog
();
if
(
saveResult
.
HasValue
&&
saveResult
.
Value
)
view
.
dockLayoutManager
.
SaveLayoutToXml
(
saveFileDialog
.
FileName
);
}
}
}
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