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
08d3b117
Commit
08d3b117
authored
Jan 30, 2023
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页添加分组
parent
e8f8a419
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
510 additions
and
205 deletions
+510
-205
VIZ.Package.Domain/ApplicationDomainEx.cs
+5
-0
VIZ.Package.Domain/Enum/ConnGroupStatus.cs
+29
-0
VIZ.Package.Domain/Message/Conn/ConnChangedMessage.cs
+0
-8
VIZ.Package.Domain/Model/Conn/ConnGroupModel.cs
+65
-0
VIZ.Package.Domain/Model/Conn/ConnModel.cs
+26
-1
VIZ.Package.Domain/Model/Page/PageModel.cs
+14
-0
VIZ.Package.Domain/Plugin/IPluginView.cs
+4
-4
VIZ.Package.Domain/VIZ.Package.Domain.csproj
+1
-0
VIZ.Package.Module.Resource/Converter/ConnGroupStatus2BrushConverter.cs
+52
-0
VIZ.Package.Module.Resource/Icons/preview_connection_32x32.png
+0
-0
VIZ.Package.Module.Resource/Icons/preview_local_32x32.png
+0
-0
VIZ.Package.Module.Resource/Icons/preview_remote_32x32.png
+0
-0
VIZ.Package.Module.Resource/VIZ.Package.Module.Resource.csproj
+9
-1
VIZ.Package.Module/Control/ViewModel/ControlViewModel.cs
+62
-55
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ListEdit/ListEditPanel.xaml
+1
-1
VIZ.Package.Module/ControlObject/FieldTree/View/FieldTreeView.xaml
+1
-1
VIZ.Package.Module/Main/View/MainConnView.xaml
+78
-23
VIZ.Package.Module/Main/ViewModel/MainConnViewModel.cs
+41
-36
VIZ.Package.Module/Page/Group/View/PageGroupView.xaml
+7
-1
VIZ.Package.Module/Page/Group/ViewModel/PageGroupViewModel.cs
+33
-0
VIZ.Package.Module/Page/Templage/View/PageTemplateView.xaml
+2
-2
VIZ.Package.Module/Preview/VizPreview/ViewModel/VizPreviewViewModel.cs
+51
-51
VIZ.Package.Module/Setting/Conn/View/ConnSettingView.xaml
+15
-10
VIZ.Package.Module/Setting/Conn/ViewModel/ConnSettingViewModel.cs
+7
-11
VIZ.Package.Service/DB/Page/PageService.cs
+2
-0
VIZ.Package.Storage/Entity/Page/PageEntity.cs
+5
-0
No files found.
VIZ.Package.Domain/ApplicationDomainEx.cs
View file @
08d3b117
...
...
@@ -88,6 +88,11 @@ namespace VIZ.Package.Domain
// =============================================================
/// <summary>
/// 预览连接分组
/// </summary>
public
static
ConnGroupModel
PreviewConnGroup
{
get
;
set
;
}
/// <summary>
/// 预览连接
/// </summary>
public
static
ConnModel
PreviewConn
{
get
;
set
;
}
...
...
VIZ.Package.Domain/Enum/ConnGroupStatus.cs
0 → 100644
View file @
08d3b117
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.Package.Domain
{
/// <summary>
/// 连接分组状态
/// </summary>
public
enum
ConnGroupStatus
{
/// <summary>
/// 全部断开
/// </summary>
AllDisconnection
,
/// <summary>
/// 有至少一个处于连接状态
/// </summary>
AnyConnection
,
/// <summary>
/// 全部处于连接状态
/// </summary>
AllConnection
}
}
VIZ.Package.Domain/Message/Conn/ConnChangedMessage.cs
View file @
08d3b117
...
...
@@ -12,14 +12,6 @@ namespace VIZ.Package.Domain
/// </summary>
public
class
ConnChangedMessage
{
/// <summary>
/// 老的连接分组
/// </summary>
public
ConnGroupModel
OldGroup
{
get
;
set
;
}
/// <summary>
/// 新的连接分组
/// </summary>
public
ConnGroupModel
NewGroup
{
get
;
set
;
}
}
}
VIZ.Package.Domain/Model/Conn/ConnGroupModel.cs
View file @
08d3b117
...
...
@@ -56,6 +56,20 @@ namespace VIZ.Package.Domain
#
endregion
#
region
IsDefault
--
是否是默认分组
private
bool
isDefault
;
/// <summary>
/// 是否是默认分组
/// </summary>
public
bool
IsDefault
{
get
{
return
isDefault
;
}
set
{
isDefault
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
IsDefault
));
}
}
#
endregion
#
region
EngineType
--
引擎类型
private
EngineType
engineType
;
...
...
@@ -84,5 +98,56 @@ namespace VIZ.Package.Domain
}
#
endregion
#
region
IsLocalPreview
--
是否是本地预览
private
bool
isLocalPreview
;
/// <summary>
/// 是否是本地预览
/// </summary>
public
bool
IsLocalPreview
{
get
{
return
isLocalPreview
;
}
set
{
isLocalPreview
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
IsLocalPreview
));
}
}
#
endregion
#
region
Status
--
状态
private
ConnGroupStatus
status
;
/// <summary>
/// 状态
/// </summary>
public
ConnGroupStatus
Status
{
get
{
return
status
;
}
set
{
status
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
Status
));
}
}
#
endregion
/// <summary>
/// 更新状态
/// </summary>
public
void
UpdateStatus
()
{
// 没有连接项 | 全断开
if
(
this
.
Items
.
Count
==
0
||
this
.
Items
.
Where
(
p
=>
p
.
IsEnabled
).
All
(
p
=>
!
p
.
IsConnected
))
{
this
.
Status
=
ConnGroupStatus
.
AllDisconnection
;
return
;
}
// 全连接
if
(
this
.
Items
.
Where
(
p
=>
p
.
IsEnabled
).
All
(
p
=>
p
.
IsConnected
))
{
this
.
Status
=
ConnGroupStatus
.
AllConnection
;
return
;
}
// 部分连接
this
.
Status
=
ConnGroupStatus
.
AnyConnection
;
}
}
}
VIZ.Package.Domain/Model/Conn/ConnModel.cs
View file @
08d3b117
...
...
@@ -125,6 +125,20 @@ namespace VIZ.Package.Domain
#
endregion
#
region
ErrorMessage
--
错误信息
private
string
errorMessage
;
/// <summary>
/// 错误信息
/// </summary>
public
string
ErrorMessage
{
get
{
return
errorMessage
;
}
set
{
errorMessage
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ErrorMessage
));
}
}
#
endregion
// ============================================================================
#
region
IsLoading
--
是否正在等待
...
...
@@ -147,11 +161,19 @@ namespace VIZ.Package.Domain
public
IPackageEndpointManager
EndpointManager
{
get
;
private
set
;
}
/// <summary>
/// 所属分组
/// </summary>
public
ConnGroupModel
OwnerGroup
{
get
;
set
;
}
/// <summary>
/// 初始化终结点管理器
/// </summary>
/// <param name="groupModel">分组</param>
/// <param name="endpointManager">终结点管理器</param>
public
void
InitEndpointManager
(
IPackageEndpointManager
endpointManager
)
public
void
InitEndpointManager
(
ConnGroupModel
groupModel
,
IPackageEndpointManager
endpointManager
)
{
this
.
OwnerGroup
=
groupModel
;
if
(
this
.
EndpointManager
!=
null
)
{
this
.
EndpointManager
.
ConnectionStateChanged
-=
EndpointManager_ConnectionStateChanged
;
...
...
@@ -179,6 +201,9 @@ namespace VIZ.Package.Domain
WPFHelper
.
BeginInvoke
(()
=>
{
this
.
IsConnected
=
e
.
IsConnected
;
this
.
ErrorMessage
=
e
.
Exception
?.
Message
;
this
.
OwnerGroup
?.
UpdateStatus
();
});
}
}
...
...
VIZ.Package.Domain/Model/Page/PageModel.cs
View file @
08d3b117
...
...
@@ -96,5 +96,19 @@ namespace VIZ.Package.Domain
}
#
endregion
#
region
ConnGroupID
--
连接分组
ID
private
Guid
connGroupID
;
/// <summary>
/// 连接分组ID
/// </summary>
public
Guid
ConnGroupID
{
get
{
return
connGroupID
;
}
set
{
connGroupID
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ConnGroupID
));
}
}
#
endregion
}
}
VIZ.Package.Domain/Plugin/IPluginView.cs
View file @
08d3b117
...
...
@@ -15,25 +15,25 @@ namespace VIZ.Package.Domain
/// 上版
/// </summary>
/// <param name="conns">连接</param>
void
TakIn
(
IList
<
ConnModel
>
conns
);
void
TakIn
(
ConnModel
conns
);
/// <summary>
/// 继续
/// </summary>
/// <param name="conns">连接</param>
void
TakeContinue
(
IList
<
ConnModel
>
conns
);
void
TakeContinue
(
ConnModel
conns
);
/// <summary>
/// 下版子
/// </summary>
/// <param name="conns">连接</param>
void
TakeOut
(
IList
<
ConnModel
>
conns
);
void
TakeOut
(
ConnModel
conns
);
/// <summary>
/// 更新
/// </summary>
/// <param name="conns">连接</param>
void
TakeUpdate
(
IList
<
ConnModel
>
conns
);
void
TakeUpdate
(
ConnModel
conns
);
/// <summary>
/// 预览上版子
...
...
VIZ.Package.Domain/VIZ.Package.Domain.csproj
View file @
08d3b117
...
...
@@ -75,6 +75,7 @@
<Compile Include="ApplicationConstants.cs" />
<Compile Include="ApplicationDomainEx.cs" />
<Compile Include="Core\GridColumnDefinition.cs" />
<Compile Include="Enum\ConnGroupStatus.cs" />
<Compile Include="Enum\ModulePluginIds.cs" />
<Compile Include="Enum\ViewServiceKeys.cs" />
<Compile Include="Info\VizTreeNodeInfo.cs" />
...
...
VIZ.Package.Module.Resource/Converter/ConnGroupStatus2BrushConverter.cs
0 → 100644
View file @
08d3b117
using
System
;
using
System.Collections.Generic
;
using
System.Globalization
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Data
;
using
System.Windows.Media
;
using
VIZ.Package.Domain
;
namespace
VIZ.Package.Module.Resource
{
/// <summary>
/// 连接分组状态 到 纯色画刷转化器
/// </summary>
public
class
ConnGroupStatus2BrushConverter
:
IValueConverter
{
/// <summary>
/// 全断开画刷
/// </summary>
public
SolidColorBrush
AllDisconnectionBrush
{
get
;
set
;
}
/// <summary>
/// 部分连接画刷
/// </summary>
public
SolidColorBrush
AnyConnectionBrush
{
get
;
set
;
}
/// <summary>
/// 全连接画刷
/// </summary>
public
SolidColorBrush
AllConnectionBrush
{
get
;
set
;
}
public
object
Convert
(
object
value
,
Type
targetType
,
object
parameter
,
CultureInfo
culture
)
{
if
(!(
value
is
ConnGroupStatus
status
))
return
null
;
switch
(
status
)
{
case
ConnGroupStatus
.
AllDisconnection
:
return
this
.
AllDisconnectionBrush
;
case
ConnGroupStatus
.
AnyConnection
:
return
this
.
AnyConnectionBrush
;
case
ConnGroupStatus
.
AllConnection
:
return
this
.
AllConnectionBrush
;
default
:
return
null
;
}
}
public
object
ConvertBack
(
object
value
,
Type
targetType
,
object
parameter
,
CultureInfo
culture
)
{
throw
new
NotImplementedException
();
}
}
}
VIZ.Package.Module.Resource/Icons/preview_connection_32x32.png
0 → 100644
View file @
08d3b117
352 Bytes
VIZ.Package.Module.Resource/Icons/preview_local_32x32.png
0 → 100644
View file @
08d3b117
319 Bytes
VIZ.Package.Module.Resource/Icons/preview_remote_32x32.png
0 → 100644
View file @
08d3b117
655 Bytes
VIZ.Package.Module.Resource/VIZ.Package.Module.Resource.csproj
View file @
08d3b117
...
...
@@ -99,6 +99,7 @@
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Converter\ConnGroupStatus2BrushConverter.cs" />
<Compile Include="Converter\ResourceFileSelectionModeConverter.cs" />
<Compile Include="Converter\RichText2TextConverter.cs" />
<Compile Include="Converter\RowHandleConverter.cs" />
...
...
@@ -207,6 +208,12 @@
<ItemGroup>
<Resource Include="Icons\icon_save_as_hover_30x30.png" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Resource Include="Icons\preview_local_32x32.png" />
<Resource Include="Icons\preview_remote_32x32.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\preview_connection_32x32.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
VIZ.Package.Module/Control/ViewModel/ControlViewModel.cs
View file @
08d3b117
...
...
@@ -82,18 +82,20 @@ namespace VIZ.Package.Module
service
.
TryUpdateControlFieldListValue
();
// 执行上版流程
this
.
Execute
(
controlObjectAction
:
(
obj
,
conn
)
=>
this
.
Execute
((
obj
,
view
,
conn
)
=>
{
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
false
);
this
.
vizCommandService
.
SetObject
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
ScenePath
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
this
.
vizCommandControlObjectService
.
SetControlObject
(
conn
,
obj
);
if
(
obj
!=
null
)
{
this
.
vizCommandControlObjectService
.
SetControlObject
(
conn
,
obj
);
}
if
(
view
!=
null
)
{
view
.
TakIn
(
conn
);
}
this
.
vizCommandService
.
SetEnabledUpdate
(
conn
,
true
);
this
.
vizCommandService
.
Start
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
},
pluginAction
:
(
view
,
conns
)
=>
{
view
.
TakIn
(
conns
);
});
}
...
...
@@ -111,14 +113,10 @@ namespace VIZ.Package.Module
/// </summary>
private
void
Continue
()
{
this
.
Execute
(
controlObjectAction
:
(
obj
,
conn
)
=>
this
.
Execute
((
obj
,
view
,
conn
)
=>
{
this
.
vizCommandService
.
TakeContinue
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
},
pluginAction
:
(
view
,
conns
)
=>
{
view
.
TakeContinue
(
conns
);
view
?.
TakeContinue
(
conn
);
});
}
...
...
@@ -136,14 +134,10 @@ namespace VIZ.Package.Module
/// </summary>
private
void
TakeOut
()
{
this
.
Execute
(
controlObjectAction
:
(
obj
,
conn
)
=>
this
.
Execute
((
obj
,
view
,
conn
)
=>
{
this
.
vizCommandService
.
TakeOut
(
conn
,
ApplicationDomainEx
.
CurrentPage
.
Layer
);
},
pluginAction
:
(
view
,
conns
)
=>
{
view
.
TakeOut
(
conns
);
view
?.
TakeOut
(
conn
);
});
}
...
...
@@ -170,14 +164,13 @@ namespace VIZ.Package.Module
service
.
TryUpdateControlFieldListValue
();
// 执行更新流程
this
.
Execute
(
controlObjectAction
:
(
obj
,
conn
)
=>
{
this
.
vizCommandControlObjectService
.
SetControlObject
(
conn
,
obj
);
},
pluginAction
:
(
view
,
conns
)
=>
this
.
Execute
((
obj
,
view
,
conn
)
=>
{
view
.
TakeUpdate
(
conns
);
if
(
obj
!=
null
)
{
this
.
vizCommandControlObjectService
.
SetControlObject
(
conn
,
obj
);
}
view
?.
TakeOut
(
conn
);
});
}
...
...
@@ -190,25 +183,33 @@ namespace VIZ.Package.Module
/// <summary>
/// 执行
/// </summary>
/// <param name="controlObjectAction">控制对象行为</param>
/// <param name="pluginAction">插件行为</param>
private
void
Execute
(
Action
<
ControlObjectModel
,
ConnModel
>
controlObjectAction
,
Action
<
IPluginView
,
IList
<
ConnModel
>>
pluginAction
)
/// <param name="action">行为</param>
private
void
Execute
(
Action
<
ControlObjectModel
,
IPluginView
,
ConnModel
>
action
)
{
// 是否拥有打开的页或模板页
if
(
ApplicationDomainEx
.
CurrentPage
==
null
)
return
;
//
是否有启用的连接分组
ConnGroupModel
group
=
ApplicationDomainEx
.
ConnGroups
.
FirstOrDefault
(
p
=>
p
.
IsEnabled
);
if
(
group
==
null
)
//
插件服务
IPluginService
pluginService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPluginService
>(
ViewServiceKeys
.
PLUGIN_SERVICE
);
if
(
pluginService
==
null
)
return
;
// 控制字段树服务
IFieldTreeService
fieldTreeService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IFieldTreeService
>(
ViewServiceKeys
.
FIELD_TREE_SERVICE
);
ControlObjectModel
controlObject
=
fieldTreeService
?.
GetControlObject
();
if
(
fieldTreeService
==
null
)
return
;
// Step 1. 处理控制对象
if
(
controlObject
!=
null
)
ControlObjectModel
controlObject
=
fieldTreeService
.
GetControlObject
();
// 模板
if
(
ApplicationDomainEx
.
CurrentPage
is
PageTemplateModel
template
)
{
// 模板上版等操作使用默认分组
ConnGroupModel
group
=
ApplicationDomainEx
.
ConnGroups
.
FirstOrDefault
(
p
=>
p
.
IsDefault
);
if
(
group
==
null
)
return
;
foreach
(
var
item
in
group
.
Items
)
{
if
(!
item
.
IsEnabled
||
!
item
.
IsConnected
)
...
...
@@ -216,7 +217,7 @@ namespace VIZ.Package.Module
try
{
controlObjectAction
(
controlObject
,
item
);
action
(
controlObject
,
null
,
item
);
}
catch
(
Exception
ex
)
{
...
...
@@ -224,29 +225,35 @@ namespace VIZ.Package.Module
}
}
}
// 页
else
if
(
ApplicationDomainEx
.
CurrentPage
is
PageModel
page
)
{
// 模板上版等操作使用默认分组
ConnGroupModel
group
=
ApplicationDomainEx
.
ConnGroups
.
FirstOrDefault
(
p
=>
p
.
GroupID
==
page
.
ConnGroupID
);
if
(
group
==
null
)
{
// 记录日志
log
.
Error
(
$"ConnGroupID:
{
page
.
ConnGroupID
}
is not found."
);
// Step 2. 执行插件脚本
if
(!(
ApplicationDomainEx
.
CurrentPage
is
PageModel
page
))
return
;
if
(
string
.
IsNullOrWhiteSpace
(
page
.
PluginID
))
return
;
return
;
}
IPluginService
pluginService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPluginService
>(
ViewServiceKeys
.
PLUGIN_SERVICE
);
if
(
pluginService
==
null
)
return
;
IPluginView
view
=
pluginService
.
GetCurrentPluginView
()
as
IPluginView
;
IPluginView
view
=
pluginService
.
GetCurrentPluginView
()
as
IPluginView
;
if
(
view
==
null
)
return
;
foreach
(
var
item
in
group
.
Items
)
{
if
(!
item
.
IsEnabled
||
!
item
.
IsConnected
)
continue
;
try
{
pluginAction
(
view
,
group
.
Items
.
Where
(
p
=>
p
.
IsEnabled
&&
p
.
IsConnected
).
ToList
());
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
try
{
action
(
controlObject
,
view
,
item
);
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
}
}
}
}
}
...
...
VIZ.Package.Module/ControlObject/FieldEdit/Edit/ListEdit/ListEditPanel.xaml
View file @
08d3b117
...
...
@@ -125,7 +125,7 @@
<dxg:GridControl.View>
<dxg:TableView x:Name="tabView" AllowEditing="True" ShowIndicator="False"
IsColumnMenuEnabled="False"
NavigationStyle="Cell" EditorShowMode="MouseDown"
NavigationStyle="Cell" EditorShowMode="MouseDown"
ShowVerticalLines="False"
ShowGroupPanel="False"
AllowDrop="True"
ShowBandsPanel="False"
...
...
VIZ.Package.Module/ControlObject/FieldTree/View/FieldTreeView.xaml
View file @
08d3b117
...
...
@@ -28,7 +28,7 @@
<dxg:GridControl.View>
<dxg:TreeListView AllowEditing="False" ShowIndicator="False"
IsColumnMenuEnabled="False"
NavigationStyle="Row"
NavigationStyle="Row"
ShowVerticalLines="False"
ShowBandsPanel="False"
ShowTotalSummary="False"
ShowFixedTotalSummary="False"
...
...
VIZ.Package.Module/Main/View/MainConnView.xaml
View file @
08d3b117
...
...
@@ -10,6 +10,7 @@
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:fcore="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
xmlns:plugin="clr-namespace:VIZ.Package.Plugin;assembly=VIZ.Package.Plugin"
xmlns:resource="clr-namespace:VIZ.Package.Module.Resource;assembly=VIZ.Package.Module.Resource"
xmlns:local="clr-namespace:VIZ.Package.Module"
d:DataContext="{d:DesignInstance Type=local:MainConnViewModel}"
mc:Ignorable="d" x:Name="uc"
...
...
@@ -22,15 +23,16 @@
</ResourceDictionary.MergedDictionaries>
<fcore:Bool2BoolConverter x:Key="Bool2BoolConverter"></fcore:Bool2BoolConverter>
<fcore:Bool2SolidColorBrushConverter x:Key="Bool2SolidColorBrushConverter"
TrueBrush="#FF92FF3D"
FalseBrush="#FFFF5353"
NoneBrush="#FFFF5353"></fcore:Bool2SolidColorBrushConverter>
<resource:ConnGroupStatus2BrushConverter x:Key="ConnGroupStatus2BrushConverter"
AllDisconnectionBrush="#FFFF5353"
AnyConnectionBrush="Yellow"
AllConnectionBrush="#FF92FF3D"></resource:ConnGroupStatus2BrushConverter>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<ListBox Style="{StaticResource ListBox_None}"
<ListBox Style="{StaticResource ListBox_None}"
Margin="10,0,0,0"
ItemsSource="{Binding Path=ItemsSrouce}"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden">
...
...
@@ -41,25 +43,78 @@
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Border>
<StackPanel Orientation="Horizontal" Background="Transparent" VerticalAlignment="Center"
IsEnabled="{Binding Path=IsLoading,Converter={StaticResource Bool2BoolConverter}}"
TextBlock.Foreground="{Binding Path=IsConnected,Converter={StaticResource Bool2SolidColorBrushConverter}}"
TextBlock.FontSize="12"
Cursor="Hand" MinWidth="120" Margin="10,0,0,0">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand Event="PreviewMouseLeftButtonDown"
CommandParameter="{Binding .}"
Command="{Binding Path=DataContext.ItemClickCommand,ElementName=uc}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
<TextBlock Text="{Binding Path=IP}" VerticalAlignment="Center"></TextBlock>
<TextBlock Text=":" Margin="3,0,3,0" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="{Binding Path=Port}" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="[" Margin="3,0,3,0" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="{Binding Path=Remark}" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="]" Margin="3,0,3,0" VerticalAlignment="Center"></TextBlock>
<Grid Background="Transparent" x:Name="root">
<!-- 内容 -->
<StackPanel Orientation="Horizontal">
<Border Width="16" Height="16" VerticalAlignment="Center"
Background="{Binding Path=Status,Converter={StaticResource ConnGroupStatus2BrushConverter}}">
<Border.OpacityMask>
<ImageBrush ImageSource="/VIZ.Package.Module.Resource;component/Icons/preview_connection_32x32.png"></ImageBrush>
</Border.OpacityMask>
</Border>
<TextBlock Text="{Binding Path=Name}" Grid.Column="1" VerticalAlignment="Center" Margin="10,0,50,0"
MaxWidth="200"
Foreground="{Binding Path=Status,Converter={StaticResource ConnGroupStatus2BrushConverter}}"
TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"></TextBlock>
</StackPanel>
</Border>
<!-- 弹出框 -->
<Popup AllowsTransparency="True"
PopupAnimation="Fade"
PlacementTarget="{Binding ElementName=root}"
Placement="Top"
Width="320"
MinHeight="200"
IsOpen="{Binding ElementName=root, Path=IsMouseOver, Mode=OneWay}">
<Border Background="#FF252526" BorderBrush="#FF4E4BDE" BorderThickness="1" Width="300">
<Grid Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="40"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<TextBlock Text="分组: " Foreground="#aaffffff"></TextBlock>
<TextBlock Text="{Binding Path=Name}" Margin="10,0,10,0" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"></TextBlock>
</StackPanel>
<ListBox Style="{StaticResource ListBox_None}" ItemsSource="{Binding Path=Items}" Grid.Row="1">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel x:Name="innerRoot"
Orientation="Horizontal" Background="Transparent" VerticalAlignment="Center"
IsEnabled="{Binding Path=IsLoading,Converter={StaticResource Bool2BoolConverter}}"
TextBlock.Foreground="#FFFF5353"
TextBlock.FontSize="12" Height="24 "
Cursor="Hand">
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand Event="PreviewMouseLeftButtonDown"
CommandParameter="{Binding .}"
Command="{Binding Path=DataContext.ItemClickCommand,ElementName=uc}"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
<TextBlock Text="{Binding Path=IP}" VerticalAlignment="Center"></TextBlock>
<TextBlock Text=":" Margin="3,0,3,0" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="{Binding Path=Port}" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="[" Margin="3,0,3,0" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="{Binding Path=Remark}" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="]" Margin="3,0,3,0" VerticalAlignment="Center"></TextBlock>
</StackPanel>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Path=IsConnected}" Value="True">
<Setter Property="TextBlock.Foreground" TargetName="innerRoot" Value="#FF92FF3D"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=IsEnabled}" Value="False">
<Setter Property="IsEnabled" Value="False"></Setter>
<Setter Property="Opacity" Value="0.4"></Setter>
<Setter Property="TextBlock.Foreground" TargetName="innerRoot" Value="White"></Setter>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Border>
</Popup>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
...
...
VIZ.Package.Module/Main/ViewModel/MainConnViewModel.cs
View file @
08d3b117
...
...
@@ -63,11 +63,11 @@ namespace VIZ.Package.Module
#
region
ItemsSrouce
--
数据源
private
ObservableCollection
<
Conn
Model
>
itemsSrouce
=
new
ObservableCollection
<
Conn
Model
>();
private
ObservableCollection
<
Conn
GroupModel
>
itemsSrouce
=
new
ObservableCollection
<
ConnGroup
Model
>();
/// <summary>
/// 数据源
/// </summary>
public
ObservableCollection
<
ConnModel
>
ItemsSrouce
public
ObservableCollection
<
Conn
Group
Model
>
ItemsSrouce
{
get
{
return
itemsSrouce
;
}
set
{
itemsSrouce
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ItemsSrouce
));
}
...
...
@@ -122,15 +122,7 @@ namespace VIZ.Package.Module
/// <param name="msg">消息</param>
private
void
OnConnChangedMessage
(
ConnChangedMessage
msg
)
{
if
(
msg
.
OldGroup
!=
null
)
{
foreach
(
ConnModel
item
in
msg
.
OldGroup
.
Items
)
{
item
.
Dispose
();
}
}
this
.
InitAndConnnectGroups
(
msg
.
NewGroup
);
this
.
InitAndConnnectGroups
();
}
/// <summary>
...
...
@@ -142,46 +134,59 @@ namespace VIZ.Package.Module
List
<
ConnGroupModel
>
groups
=
this
.
connService
.
LoadGroups
();
ApplicationDomainEx
.
ConnGroups
=
groups
;
ConnGroupModel
group
=
groups
.
FirstOrDefault
(
p
=>
p
.
IsEnabled
==
true
);
this
.
InitAndConnnectGroups
(
group
);
this
.
InitAndConnnectGroups
();
}
/// <summary>
/// 初始化 & 连接
/// </summary>
/// <param name="group">连接分组</param>
private
void
InitAndConnnectGroups
(
ConnGroupModel
group
)
private
void
InitAndConnnectGroups
()
{
this
.
ItemsSrouce
.
Clear
();
// 清理之前的连接
foreach
(
ConnGroupModel
group
in
this
.
ItemsSrouce
)
{
foreach
(
ConnModel
item
in
group
.
Items
)
{
if
(
item
==
ApplicationDomainEx
.
PreviewConn
)
continue
;
// 预览连接
this
.
ItemsSrouce
.
Add
(
ApplicationDomainEx
.
PreviewConn
);
item
.
Dispose
();
}
}
this
.
ItemsSrouce
.
Clear
();
if
(
group
==
null
)
return
;
// 预览分组
this
.
ItemsSrouce
.
Add
(
ApplicationDomainEx
.
PreviewConnGroup
)
;
foreach
(
ConnModel
item
in
group
.
Items
)
// 其他分组
foreach
(
ConnGroupModel
group
in
ApplicationDomainEx
.
ConnGroups
)
{
if
(!
item
.
IsEnabled
)
if
(!
group
.
IsEnabled
)
continue
;
item
.
InitEndpointManager
(
new
VizEndpointManager
(
item
.
ConnID
.
ToString
(),
item
.
IP
,
item
.
Port
));
foreach
(
ConnModel
item
in
group
.
Items
)
{
if
(!
item
.
IsEnabled
)
continue
;
this
.
ItemsSrouce
.
Add
(
item
);
item
.
InitEndpointManager
(
group
,
new
VizEndpointManager
(
item
.
ConnID
.
ToString
(),
item
.
IP
,
item
.
Port
)
);
// 启动连接
ThreadHelper
.
SafeRun
(()
=>
{
try
{
item
.
EndpointManager
.
Connect
();
}
catch
(
Exception
ex
)
// 启动连接
ThreadHelper
.
SafeRun
(()
=>
{
log
.
Error
(
ex
);
}
});
try
{
item
.
EndpointManager
.
Connect
();
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
}
});
}
this
.
ItemsSrouce
.
Add
(
group
);
}
}
}
...
...
VIZ.Package.Module/Page/Group/View/PageGroupView.xaml
View file @
08d3b117
...
...
@@ -99,6 +99,12 @@
IsTextEditable="False"></dxe:ComboBoxEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn Header="连接" FieldName="ConnGroupID" AllowSorting="False" AllowColumnFiltering="False">
<dxg:GridColumn.EditSettings>
<dxe:ComboBoxEditSettings ItemsSource="{Binding ElementName=uc, Path=DataContext.ConnGroups,Mode=TwoWay}"
DisplayMember="Name" ValueMember="GroupID" IsTextEditable="False"></dxe:ComboBoxEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn Header="引擎类型" FieldName="EngineType" ReadOnly="True" AllowSorting="False" AllowColumnFiltering="False"></dxg:GridColumn>
<dxg:GridColumn Header="模板类型" ReadOnly="True" AllowSorting="False" AllowColumnFiltering="False"
Binding="{Binding Path=TemplateType,Converter={StaticResource Enum2EnumDescriptionConverter}}">
...
...
@@ -108,7 +114,7 @@
<dxg:GridControl.View>
<dxg:TableView IsColumnMenuEnabled="False"
AllowEditing="True" ShowIndicator="False"
NavigationStyle="Cell"
NavigationStyle="Cell"
ShowVerticalLines="False"
ShowGroupPanel="False" EditorShowMode="MouseUp"
AllowDragDrop="True"
ShowBandsPanel="False"
...
...
VIZ.Package.Module/Page/Group/ViewModel/PageGroupViewModel.cs
View file @
08d3b117
...
...
@@ -58,6 +58,7 @@ namespace VIZ.Package.Module
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectCloseMessage
>(
this
,
this
.
OnProjectCloseMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectSaveMessage
>(
this
,
this
.
OnProjectSaveMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ConnChangedMessage
>(
this
,
this
.
OnConnChangedMessage
);
}
// ======================================================================================
...
...
@@ -159,6 +160,20 @@ namespace VIZ.Package.Module
#
endregion
#
region
ConnGroups
--
连接分组集合
private
List
<
ConnGroupModel
>
connGroups
;
/// <summary>
/// 连接分组集合
/// </summary>
public
List
<
ConnGroupModel
>
ConnGroups
{
get
{
return
connGroups
;
}
set
{
connGroups
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
ConnGroups
));
}
}
#
endregion
// ======================================================================================
// Command
// ======================================================================================
...
...
@@ -316,6 +331,7 @@ namespace VIZ.Package.Module
this
.
SelectedPageGroupModel
=
null
;
this
.
SelectedPageModel
=
null
;
this
.
IsLoading
=
true
;
this
.
UpdateConnGroups
();
ThreadHelper
.
SafeRun
(()
=>
{
...
...
@@ -370,6 +386,15 @@ namespace VIZ.Package.Module
this
.
pageService
.
SavePageGroups
(
this
.
PageGroupModels
);
}
/// <summary>
/// 连接切换消息
/// </summary>
/// <param name="msg">消息</param>
private
void
OnConnChangedMessage
(
ConnChangedMessage
msg
)
{
this
.
UpdateConnGroups
();
}
// ======================================================================================
// Public Function
// ======================================================================================
...
...
@@ -509,5 +534,13 @@ namespace VIZ.Package.Module
return
false
;
}
/// <summary>
/// 更新连接分组
/// </summary>
public
void
UpdateConnGroups
()
{
this
.
ConnGroups
=
ApplicationDomainEx
.
ConnGroups
;
}
}
}
VIZ.Package.Module/Page/Templage/View/PageTemplateView.xaml
View file @
08d3b117
...
...
@@ -67,7 +67,7 @@
<dxg:GridControl.View>
<dxg:TableView IsColumnMenuEnabled="False"
AllowEditing="True" ShowIndicator="False"
NavigationStyle="Cell"
NavigationStyle="Cell"
ShowVerticalLines="False"
ShowGroupPanel="False" EditorShowMode="MouseUp"
AllowDragDrop="True"
ShowBandsPanel="False"
...
...
@@ -114,7 +114,7 @@
<dxg:GridControl.View>
<dxg:TableView IsColumnMenuEnabled="False"
AllowEditing="True" ShowIndicator="False"
NavigationStyle="Cell"
NavigationStyle="Cell"
ShowVerticalLines="False"
ShowGroupPanel="False" EditorShowMode="MouseUp"
AllowDragDrop="False"
ShowBandsPanel="False"
...
...
VIZ.Package.Module/Preview/VizPreview/ViewModel/VizPreviewViewModel.cs
View file @
08d3b117
...
...
@@ -259,14 +259,10 @@ namespace VIZ.Package.Module
/// </summary>
private
void
Play
()
{
this
.
Execute
(
action
:
(
conn
)
=>
this
.
Execute
((
obj
,
view
,
conn
)
=>
{
this
.
vizCommandService
.
Start
(
conn
,
null
,
VizLayer
.
MAIN_LAYER
);
},
pluginAction
:
(
view
,
conn
)
=>
{
view
.
PreviewIn
(
conn
);
view
?.
PreviewIn
(
conn
);
});
}
...
...
@@ -284,14 +280,10 @@ namespace VIZ.Package.Module
/// </summary>
private
void
Continue
()
{
this
.
Execute
(
action
:
(
conn
)
=>
this
.
Execute
((
obj
,
view
,
conn
)
=>
{
this
.
vizCommandService
.
Continue
(
conn
,
null
,
VizLayer
.
MAIN_LAYER
);
},
pluginAction
:
(
view
,
conn
)
=>
{
view
.
PreviewContinue
(
conn
);
view
?.
PreviewContinue
(
conn
);
});
}
...
...
@@ -309,14 +301,10 @@ namespace VIZ.Package.Module
/// </summary>
private
void
Stop
()
{
this
.
Execute
(
action
:
(
conn
)
=>
this
.
Execute
((
obj
,
view
,
conn
)
=>
{
this
.
vizCommandService
.
Stop
(
conn
,
null
,
VizLayer
.
MAIN_LAYER
);
},
pluginAction
:
(
view
,
conn
)
=>
{
view
.
PreviewOut
(
conn
);
view
?.
PreviewOut
(
conn
);
});
}
...
...
@@ -489,6 +477,14 @@ namespace VIZ.Package.Module
return
;
VizConfigEntity
vizConfig
=
ApplicationDomainEx
.
VizConfig
;
ConnGroupModel
connGroup
=
ApplicationDomainEx
.
PreviewConnGroup
;
if
(
connGroup
==
null
)
{
connGroup
=
new
ConnGroupModel
();
connGroup
.
Name
=
"预览"
;
connGroup
.
IsEnabled
=
true
;
connGroup
.
IsLocalPreview
=
true
;
}
ConnModel
conn
=
ApplicationDomainEx
.
PreviewConn
;
if
(
conn
!=
null
)
{
...
...
@@ -499,8 +495,13 @@ namespace VIZ.Package.Module
conn
.
IP
=
vizConfig
.
VIZ_IP
;
conn
.
Port
=
vizConfig
.
VIZ_Port
;
conn
.
Remark
=
"预览"
;
conn
.
InitEndpointManager
(
new
VizEndpointManager
(
"local"
,
vizConfig
.
VIZ_IP
,
vizConfig
.
VIZ_Port
));
conn
.
IsEnabled
=
true
;
conn
.
InitEndpointManager
(
connGroup
,
new
VizEndpointManager
(
"local"
,
vizConfig
.
VIZ_IP
,
vizConfig
.
VIZ_Port
));
connGroup
.
Items
.
Clear
();
connGroup
.
Items
.
Add
(
conn
);
ApplicationDomainEx
.
PreviewConnGroup
=
connGroup
;
ApplicationDomainEx
.
PreviewConn
=
conn
;
string
path
=
null
;
...
...
@@ -521,50 +522,49 @@ namespace VIZ.Package.Module
/// <summary>
/// 执行
/// </summary>
/// <param name="action">播放行为</param>
/// <param name="pluginAction">插件行为</param>
private
void
Execute
(
Action
<
ConnModel
>
action
,
Action
<
IPluginView
,
ConnModel
>
pluginAction
)
/// <param name="action">行为</param>
private
void
Execute
(
Action
<
ControlObjectModel
,
IPluginView
,
ConnModel
>
action
)
{
// 引擎未准备好 || 当前没有选中的节目单项目 则不处理
if
(!
this
.
IsEngineReady
||
ApplicationDomainEx
.
CurrentPage
==
null
)
return
;
// 预览连接为准备好
if
(
ApplicationDomainEx
.
PreviewConn
==
null
||
!
ApplicationDomainEx
.
PreviewConn
.
IsConnected
)
return
;
// Step 1. 播放行为
try
{
action
(
ApplicationDomainEx
.
PreviewConn
);
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
}
// Step 2. 插件行为
if
(!(
ApplicationDomainEx
.
CurrentPage
is
PageModel
page
))
return
;
if
(
string
.
IsNullOrWhiteSpace
(
page
.
PluginID
))
// 是否拥有打开的页或模板页
if
(
ApplicationDomainEx
.
CurrentPage
==
null
)
return
;
// 插件服务
IPluginService
pluginService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPluginService
>(
ViewServiceKeys
.
PLUGIN_SERVICE
);
if
(
pluginService
==
null
)
return
;
IPluginView
view
=
pluginService
.
GetCurrentPluginView
()
as
IPluginView
;
if
(
view
==
null
)
// 控制字段树服务
IFieldTreeService
fieldTreeService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IFieldTreeService
>(
ViewServiceKeys
.
FIELD_TREE_SERVICE
);
if
(
fieldTreeService
==
null
)
return
;
try
ControlObjectModel
controlObject
=
fieldTreeService
.
GetControlObject
();
// 模板
if
(
ApplicationDomainEx
.
CurrentPage
is
PageTemplateModel
template
)
{
pluginAction
(
view
,
ApplicationDomainEx
.
PreviewConn
);
if
(
ApplicationDomainEx
.
PreviewConn
!=
null
&&
ApplicationDomainEx
.
PreviewConn
.
IsConnected
)
{
action
(
controlObject
,
null
,
ApplicationDomainEx
.
PreviewConn
);
}
}
catch
(
Exception
ex
)
// 页
else
if
(
ApplicationDomainEx
.
CurrentPage
is
PageModel
page
)
{
log
.
Error
(
ex
);
IPluginView
view
=
pluginService
.
GetCurrentPluginView
()
as
IPluginView
;
try
{
if
(
ApplicationDomainEx
.
PreviewConn
!=
null
&&
ApplicationDomainEx
.
PreviewConn
.
IsConnected
)
{
action
(
controlObject
,
view
,
ApplicationDomainEx
.
PreviewConn
);
}
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
}
}
}
...
...
VIZ.Package.Module/Setting/Conn/View/ConnSettingView.xaml
View file @
08d3b117
...
...
@@ -23,7 +23,7 @@
<ResourceDictionary Source="/VIZ.Framework.Common.Resource;component/Style/GridSplitter/GridSplitter_None.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<resource:RowHandleConverter x:Key="RowHandleConverter"></resource:RowHandleConverter>
<fcore:Bool2StringConverter x:Key="Bool2StringConverter" TrueResult="
启用
"></fcore:Bool2StringConverter>
<fcore:Bool2StringConverter x:Key="Bool2StringConverter" TrueResult="
默认
"></fcore:Bool2StringConverter>
</ResourceDictionary>
</UserControl.Resources>
...
...
@@ -33,11 +33,11 @@
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="
450
" MinWidth="450" MaxWidth="800"></ColumnDefinition>
<ColumnDefinition Width="
*
" MinWidth="450" MaxWidth="800"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<GroupBox Header="分组" Margin="
10,10,10,10" Padding="10
">
<GroupBox Header="分组" Margin="
5" Padding="5
">
<dxg:GridControl ItemsSource="{Binding Path=Groups}" ShowBorder="False"
SelectedItem="{Binding Path=SelectedGroup,Mode=TwoWay}">
<dxg:GridControl.ContextMenu>
...
...
@@ -45,7 +45,7 @@
<MenuItem Header="添加分组" Command="{Binding Path=PlacementTarget.DataContext.AddGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<MenuItem Header="删除分组" Command="{Binding Path=PlacementTarget.DataContext.DeleteGroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<Separator/>
<MenuItem Header="
启用" Command="{Binding Path=PlacementTarget.DataContext.Enabled
GroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
<MenuItem Header="
设为默认分组" Command="{Binding Path=PlacementTarget.DataContext.SetDefault
GroupCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"/>
</ContextMenu>
</dxg:GridControl.ContextMenu>
<dxg:GridControl.Columns>
...
...
@@ -62,8 +62,13 @@
HorizontalContentAlignment="Left"></dxe:TextEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn Header="
是否启用" Width="80" Binding="{Binding IsEnabled
,Converter={StaticResource Bool2StringConverter}}"
<dxg:GridColumn Header="
默认分组" Width="80" Binding="{Binding IsDefault
,Converter={StaticResource Bool2StringConverter}}"
AllowSorting="False" AllowColumnFiltering="False" ReadOnly="True"></dxg:GridColumn>
<dxg:GridColumn Header="是否启用" FieldName="IsEnabled" Width="80" AllowSorting="False" AllowColumnFiltering="False">
<dxg:GridColumn.EditSettings>
<dxe:CheckEditSettings></dxe:CheckEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn Header="引擎类型" FieldName="EngineType" AllowSorting="False" AllowColumnFiltering="False"
ReadOnly="True"></dxg:GridColumn>
</dxg:GridControl.Columns>
...
...
@@ -71,7 +76,7 @@
<dxg:TableView AllowEditing="True" ShowIndicator="True"
IsColumnMenuEnabled="False"
ShowGroupPanelsForUngroupedDetails="False"
NavigationStyle="Cell"
NavigationStyle="Cell"
ShowVerticalLines="False"
ShowGroupPanel="False"
AllowDragDrop="False"
ShowBandsPanel="False"
...
...
@@ -84,10 +89,10 @@
</dxg:GridControl>
</GroupBox>
<GridSplitter HorizontalAlignment="Right" VerticalAlignment="Stretch" Width="
10
"
<GridSplitter HorizontalAlignment="Right" VerticalAlignment="Stretch" Width="
5
"
Style="{StaticResource GridSplitter_None}"></GridSplitter>
<GroupBox Header="项" Margin="
10" Padding="10
" Grid.Column="1">
<GroupBox Header="项" Margin="
5" Padding="5
" Grid.Column="1">
<dxg:GridControl ItemsSource="{Binding Path=SelectedGroup.Items}" ShowBorder="False" Grid.Column="1"
SelectedItem="{Binding Path=SelectedItem,Mode=TwoWay}">
<dxg:GridControl.ContextMenu>
...
...
@@ -107,7 +112,7 @@
<dxg:GridColumn Header="IP地址" FieldName="IP" AllowSorting="False" AllowColumnFiltering="False">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings TextWrapping="Wrap" MaskType="RegEx" HorizontalContentAlignment="Left"
Mask="(([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])"></dxe:TextEditSettings>
Mask="(([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])"></dxe:TextEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn Header="端口" FieldName="Port" AllowSorting="False" AllowColumnFiltering="False">
...
...
@@ -131,7 +136,7 @@
<dxg:GridControl.View>
<dxg:TableView AllowEditing="True" ShowIndicator="True"
IsColumnMenuEnabled="False"
NavigationStyle="Cell"
NavigationStyle="Cell"
ShowVerticalLines="False"
ShowGroupPanel="False"
AllowDragDrop="False"
ShowBandsPanel="False"
...
...
VIZ.Package.Module/Setting/Conn/ViewModel/ConnSettingViewModel.cs
View file @
08d3b117
...
...
@@ -36,7 +36,7 @@ namespace VIZ.Package.Module
this
.
LoadedCommand
=
new
VCommand
(
this
.
Loaded
);
this
.
AddGroupCommand
=
new
VCommand
(
this
.
AddGroup
);
this
.
DeleteGroupCommand
=
new
VCommand
(
this
.
DeleteGroup
);
this
.
EnabledGroupCommand
=
new
VCommand
(
this
.
Enabled
Group
);
this
.
SetDefaultGroupCommand
=
new
VCommand
(
this
.
SetDefault
Group
);
this
.
AddItemCommand
=
new
VCommand
(
this
.
AddItem
);
this
.
DeleteItemCommand
=
new
VCommand
(
this
.
DeleteItem
);
}
...
...
@@ -162,24 +162,24 @@ namespace VIZ.Package.Module
#
endregion
#
region
Enabled
GroupCommand
--
启用组命令
#
region
SetDefault
GroupCommand
--
启用组命令
/// <summary>
///
启用
组命令
///
设置默认分
组命令
/// </summary>
public
VCommand
Enabled
GroupCommand
{
get
;
set
;
}
public
VCommand
SetDefault
GroupCommand
{
get
;
set
;
}
/// <summary>
///
启用
组
///
设置默认分
组
/// </summary>
private
void
Enabled
Group
()
private
void
SetDefault
Group
()
{
if
(
this
.
SelectedGroup
==
null
)
return
;
foreach
(
var
group
in
this
.
Groups
)
{
group
.
Is
Enabled
=
group
==
this
.
SelectedGroup
;
group
.
Is
Default
=
group
==
this
.
SelectedGroup
;
}
}
...
...
@@ -243,14 +243,10 @@ namespace VIZ.Package.Module
// 保存配置
this
.
connService
.
SaveGroups
(
this
.
Groups
);
ConnGroupModel
oldGroup
=
ApplicationDomainEx
.
ConnGroups
.
FirstOrDefault
(
p
=>
p
.
IsEnabled
);
ConnGroupModel
newGroup
=
this
.
Groups
.
FirstOrDefault
(
p
=>
p
.
IsEnabled
);
ApplicationDomainEx
.
ConnGroups
=
this
.
Groups
.
ToList
();
// 发送连接改变消息
ConnChangedMessage
msg
=
new
ConnChangedMessage
();
msg
.
OldGroup
=
oldGroup
;
msg
.
NewGroup
=
newGroup
;
ApplicationDomainEx
.
MessageManager
.
Send
(
msg
);
}
}
...
...
VIZ.Package.Service/DB/Page/PageService.cs
View file @
08d3b117
...
...
@@ -121,6 +121,7 @@ namespace VIZ.Package.Service
model
.
Order
=
entity
.
Order
;
model
.
PluginName
=
ApplicationDomainEx
.
PluginInfos
.
FirstOrDefault
(
p
=>
p
.
ID
==
entity
.
PluginID
)?.
Name
;
model
.
PageNum
=
entity
.
PageNum
;
model
.
ConnGroupID
=
entity
.
ConnGroupID
;
groupModel
.
Pages
.
Add
(
model
);
}
...
...
@@ -177,6 +178,7 @@ namespace VIZ.Package.Service
pageEntity
.
TemplateID
=
pageModel
.
TemplateID
;
pageEntity
.
PluginID
=
pageModel
.
PluginID
;
pageEntity
.
PageNum
=
pageModel
.
PageNum
;
pageEntity
.
ConnGroupID
=
pageModel
.
ConnGroupID
;
pageEntity
.
Order
=
j
;
pages
.
Add
(
pageEntity
);
...
...
VIZ.Package.Storage/Entity/Page/PageEntity.cs
View file @
08d3b117
...
...
@@ -36,5 +36,10 @@ namespace VIZ.Package.Storage
/// 页号
/// </summary>
public
int
PageNum
{
get
;
set
;
}
/// <summary>
/// 连接分组ID
/// </summary>
public
Guid
ConnGroupID
{
get
;
set
;
}
}
}
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