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
2968871b
Commit
2968871b
authored
Feb 03, 2023
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 添加图标、
2. 页删除逻辑
parent
3f2a4b6a
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
247 additions
and
24 deletions
+247
-24
VIZ.Package.Domain/Message/Page/PageDeleteMessage.cs
+19
-0
VIZ.Package.Domain/Message/Page/PageGroupDeleteMessage.cs
+19
-0
VIZ.Package.Domain/Model/Task/PackageTaskModel.cs
+23
-2
VIZ.Package.Domain/VIZ.Package.Domain.csproj
+2
-0
VIZ.Package.Module.Resource/Icons/top_icon_about_20x20.png
+0
-0
VIZ.Package.Module.Resource/Icons/top_icon_close_20x20.png
+0
-0
VIZ.Package.Module.Resource/Icons/top_icon_create_20x20.png
+0
-0
VIZ.Package.Module.Resource/Icons/top_icon_layout_20x20.png
+0
-0
VIZ.Package.Module.Resource/Icons/top_icon_open_20x20.png
+0
-0
VIZ.Package.Module.Resource/Icons/top_icon_save_20x20.png
+0
-0
VIZ.Package.Module.Resource/Style/IconButton/IconButton_Default.xaml
+1
-1
VIZ.Package.Module.Resource/VIZ.Package.Module.Resource.csproj
+19
-0
VIZ.Package.Module/Main/View/MainStatusView.xaml
+8
-0
VIZ.Package.Module/Main/View/MainTopView.xaml
+12
-6
VIZ.Package.Module/Main/ViewModel/MainStatusViewModel.cs
+23
-0
VIZ.Package.Module/Page/Group/ViewModel/PageGroupViewModel.cs
+10
-0
VIZ.Package.Module/Plugin/View/PluginView.xaml
+1
-1
VIZ.Package.Module/Plugin/ViewModel/PluginViewModel.cs
+37
-0
VIZ.Package.Module/Setting/PluginMapping/View/PluginMappingSettingView.xaml
+1
-0
VIZ.Package.Module/Setting/PluginMapping/ViewModel/PluginMappingSettingViewModel.cs
+7
-1
VIZ.Package.Module/Task/PackageTask/View/PackageTaskView.xaml
+7
-2
VIZ.Package.Module/Task/PackageTask/ViewModel/PackageTaskViewModel.cs
+58
-11
No files found.
VIZ.Package.Domain/Message/Page/PageDeleteMessage.cs
0 → 100644
View file @
2968871b
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.Package.Domain
{
/// <summary>
/// 页删除消息
/// </summary>
public
class
PageDeleteMessage
{
/// <summary>
/// 页
/// </summary>
public
PageModelBase
Page
{
get
;
set
;
}
}
}
VIZ.Package.Domain/Message/Page/PageGroupDeleteMessage.cs
0 → 100644
View file @
2968871b
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
VIZ.Package.Domain
{
/// <summary>
/// 页分组删除消息
/// </summary>
public
class
PageGroupDeleteMessage
{
/// <summary>
/// 页分组
/// </summary>
public
PageGroupModel
PageGroup
{
get
;
set
;
}
}
}
VIZ.Package.Domain/Model/Task/PackageTaskModel.cs
View file @
2968871b
...
@@ -38,7 +38,6 @@ namespace VIZ.Package.Domain
...
@@ -38,7 +38,6 @@ namespace VIZ.Package.Domain
private
set
{
view
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
View
));
}
private
set
{
view
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
View
));
}
}
}
#
endregion
#
endregion
#
region
ID
--
编号
#
region
ID
--
编号
...
@@ -148,7 +147,15 @@ namespace VIZ.Package.Domain
...
@@ -148,7 +147,15 @@ namespace VIZ.Package.Domain
public
double
Interval
public
double
Interval
{
{
get
{
return
interval
;
}
get
{
return
interval
;
}
set
{
interval
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
Interval
));
}
set
{
interval
=
Math
.
Max
(
2
,
value
);
this
.
RaisePropertyChanged
(
nameof
(
Interval
));
if
(
this
.
TimerInfo
==
null
)
return
;
this
.
TimerInfo
.
Interval
=
TimeSpan
.
FromSeconds
(
value
);
}
}
}
#
endregion
#
endregion
...
@@ -181,6 +188,20 @@ namespace VIZ.Package.Domain
...
@@ -181,6 +188,20 @@ namespace VIZ.Package.Domain
#
endregion
#
endregion
#
region
PageModel
--
所属页模型
private
PageModel
pageModel
;
/// <summary>
/// 所属页模型
/// </summary>
public
PageModel
PageModel
{
get
{
return
pageModel
;
}
set
{
pageModel
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
PageModel
));
}
}
#
endregion
/// <summary>
/// <summary>
/// 计时器信息
/// 计时器信息
/// </summary>
/// </summary>
...
...
VIZ.Package.Domain/VIZ.Package.Domain.csproj
View file @
2968871b
...
@@ -86,6 +86,8 @@
...
@@ -86,6 +86,8 @@
<Compile Include="Message\ControlObject\ControlFieldChangedMessage.cs" />
<Compile Include="Message\ControlObject\ControlFieldChangedMessage.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\PageGroupDeleteMessage.cs" />
<Compile Include="Message\Page\PageOpenMessage.cs" />
<Compile Include="Message\Page\PageOpenMessage.cs" />
<Compile Include="Message\Page\PageInitedMessage.cs" />
<Compile Include="Message\Page\PageInitedMessage.cs" />
<Compile Include="Message\Project\ProjectSaveMessage.cs" />
<Compile Include="Message\Project\ProjectSaveMessage.cs" />
...
...
VIZ.Package.Module.Resource/Icons/top_icon_about_20x20.png
0 → 100644
View file @
2968871b
3.14 KB
VIZ.Package.Module.Resource/Icons/top_icon_close_20x20.png
0 → 100644
View file @
2968871b
3.04 KB
VIZ.Package.Module.Resource/Icons/top_icon_create_20x20.png
0 → 100644
View file @
2968871b
3.05 KB
VIZ.Package.Module.Resource/Icons/top_icon_layout_20x20.png
0 → 100644
View file @
2968871b
3.05 KB
VIZ.Package.Module.Resource/Icons/top_icon_open_20x20.png
0 → 100644
View file @
2968871b
294 Bytes
VIZ.Package.Module.Resource/Icons/top_icon_save_20x20.png
0 → 100644
View file @
2968871b
3.17 KB
VIZ.Package.Module.Resource/Style/IconButton/IconButton_Default.xaml
View file @
2968871b
...
@@ -153,7 +153,7 @@
...
@@ -153,7 +153,7 @@
<Setter TargetName="icon" Property="Background" Value="#AA4E4BDE"></Setter>
<Setter TargetName="icon" Property="Background" Value="#AA4E4BDE"></Setter>
</Trigger>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.
4
"></Setter>
<Setter Property="Opacity" Value="0.
2
"></Setter>
</Trigger>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate.Triggers>
</ControlTemplate>
</ControlTemplate>
...
...
VIZ.Package.Module.Resource/VIZ.Package.Module.Resource.csproj
View file @
2968871b
...
@@ -231,5 +231,23 @@
...
@@ -231,5 +231,23 @@
<Resource Include="Icons\icon_pause_32x32.png" />
<Resource Include="Icons\icon_pause_32x32.png" />
<Resource Include="Icons\icon_play_32x32.png" />
<Resource Include="Icons\icon_play_32x32.png" />
</ItemGroup>
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\top_icon_save_20x20.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\top_icon_create_20x20.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\top_icon_open_20x20.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\top_icon_close_20x20.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\top_icon_layout_20x20.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\top_icon_about_20x20.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
</Project>
\ No newline at end of file
VIZ.Package.Module/Main/View/MainStatusView.xaml
View file @
2968871b
...
@@ -17,9 +17,17 @@
...
@@ -17,9 +17,17 @@
<TextBlock Text="项目:" Margin="10,0,0,0" Opacity="0.6"></TextBlock>
<TextBlock Text="项目:" Margin="10,0,0,0" Opacity="0.6"></TextBlock>
<TextBlock Text="{Binding ProjectName}" Margin="10,0,0,0"
<TextBlock Text="{Binding ProjectName}" Margin="10,0,0,0"
ToolTip="{Binding ProjectName}"></TextBlock>
ToolTip="{Binding ProjectName}"></TextBlock>
<!-- 场景 -->
<TextBlock Text="场景:" Margin="40,0,0,0" Opacity="0.6"></TextBlock>
<TextBlock Text="场景:" Margin="40,0,0,0" Opacity="0.6"></TextBlock>
<TextBlock Text="{Binding Scene}" Margin="10,0,0,0"
<TextBlock Text="{Binding Scene}" Margin="10,0,0,0"
ToolTip="{Binding Scene}"></TextBlock>
ToolTip="{Binding Scene}"></TextBlock>
<!-- 页编号 -->
<TextBlock Text="页编号:" Margin="40,0,0,0" Opacity="0.6"></TextBlock>
<TextBlock Text="{Binding PageNum, StringFormat={}{0:D4}}" Margin="10,0,0,0">
<TextBlock.ToolTip>
<TextBlock Text="{Binding PageNum, StringFormat={}{0:D4}}" Margin="2,0,2,0"></TextBlock>
</TextBlock.ToolTip>
</TextBlock>
</StackPanel>
</StackPanel>
<!-- 命令组 -->
<!-- 命令组 -->
...
...
VIZ.Package.Module/Main/View/MainTopView.xaml
View file @
2968871b
...
@@ -30,20 +30,26 @@
...
@@ -30,20 +30,26 @@
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal">
<dxb:MainMenuControl Caption="MainMenu" VerticalAlignment="Center">
<dxb:MainMenuControl Caption="MainMenu" VerticalAlignment="Center">
<dxb:BarSubItem Content="项目" IsEnabled="{Binding Path=IsVizPreviewReady}">
<dxb:BarSubItem Content="项目" IsEnabled="{Binding Path=IsVizPreviewReady}">
<dxb:BarButtonItem Content="新建" Command="{Binding Path=CreateProjectCommand}" />
<dxb:BarButtonItem Content="新建" Glyph="/VIZ.Package.Module.Resource;component/Icons/top_icon_create_20x20.png"
<dxb:BarButtonItem Content="打开" Command="{Binding Path=OpenProjectCommand}" />
Command="{Binding Path=CreateProjectCommand}" />
<dxb:BarButtonItem Content="保存" Command="{Binding Path=SaveProjectCommand}" />
<dxb:BarButtonItem Content="打开" Glyph="/VIZ.Package.Module.Resource;component/Icons/top_icon_open_20x20.png"
<dxb:BarButtonItem Content="关闭" Command="{Binding Path=CloseProjectCommand}" />
Command="{Binding Path=OpenProjectCommand}" />
<dxb:BarButtonItem Content="保存" Glyph="/VIZ.Package.Module.Resource;component/Icons/top_icon_save_20x20.png"
Command="{Binding Path=SaveProjectCommand}" />
<dxb:BarButtonItem Content="关闭" Glyph="/VIZ.Package.Module.Resource;component/Icons/top_icon_close_20x20.png"
Command="{Binding Path=CloseProjectCommand}" />
</dxb:BarSubItem>
</dxb:BarSubItem>
<dxb:BarSubItem Content="设置" Command="{Binding Path=SettingCommand}">
<dxb:BarSubItem Content="设置" Command="{Binding Path=SettingCommand}">
</dxb:BarSubItem>
</dxb:BarSubItem>
<dxb:BarSubItem Content="视图" ItemLinksSource="{Binding Path=ItemsSource}" ItemTemplate="{StaticResource ViewItemTemplate}">
<dxb:BarSubItem Content="视图" ItemLinksSource="{Binding Path=ItemsSource}" ItemTemplate="{StaticResource ViewItemTemplate}">
</dxb:BarSubItem>
</dxb:BarSubItem>
<dxb:BarSubItem Content="布局">
<dxb:BarSubItem Content="布局">
<dxb:BarButtonItem Content="重置布局" Command="{Binding Path=ResetLayoutCommand}" />
<dxb:BarButtonItem Content="重置布局" Glyph="/VIZ.Package.Module.Resource;component/Icons/top_icon_layout_20x20.png"
Command="{Binding Path=ResetLayoutCommand}" />
</dxb:BarSubItem>
</dxb:BarSubItem>
<dxb:BarSubItem Content="帮助">
<dxb:BarSubItem Content="帮助">
<dxb:BarButtonItem Content="关于" Command="{Binding Path=AboutCommand}"/>
<dxb:BarButtonItem Content="关于" Glyph="/VIZ.Package.Module.Resource;component/Icons/top_icon_about_20x20.png"
Command="{Binding Path=AboutCommand}"/>
</dxb:BarSubItem>
</dxb:BarSubItem>
</dxb:MainMenuControl>
</dxb:MainMenuControl>
</StackPanel>
</StackPanel>
...
...
VIZ.Package.Module/Main/ViewModel/MainStatusViewModel.cs
View file @
2968871b
...
@@ -5,6 +5,7 @@ using System.Text;
...
@@ -5,6 +5,7 @@ using System.Text;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
VIZ.Framework.Core
;
using
VIZ.Framework.Core
;
using
VIZ.Package.Domain
;
using
VIZ.Package.Domain
;
using
VIZ.Package.Storage
;
namespace
VIZ.Package.Module
namespace
VIZ.Package.Module
{
{
...
@@ -76,6 +77,20 @@ namespace VIZ.Package.Module
...
@@ -76,6 +77,20 @@ namespace VIZ.Package.Module
#
endregion
#
endregion
#
region
PageNum
--
页号
private
int
?
pageNum
;
/// <summary>
/// 页号
/// </summary>
public
int
?
PageNum
{
get
{
return
pageNum
;
}
set
{
pageNum
=
value
;
this
.
RaisePropertyChanged
(
nameof
(
PageNum
));
}
}
#
endregion
// ======================================================================
// ======================================================================
// Command
// Command
// ======================================================================
// ======================================================================
...
@@ -151,6 +166,14 @@ namespace VIZ.Package.Module
...
@@ -151,6 +166,14 @@ namespace VIZ.Package.Module
private
void
OnPageOpenMessage
(
PageOpenMessage
msg
)
private
void
OnPageOpenMessage
(
PageOpenMessage
msg
)
{
{
this
.
Scene
=
msg
.
Page
?.
Scene
;
this
.
Scene
=
msg
.
Page
?.
Scene
;
if
(
msg
.
Page
is
PageModel
page
)
{
this
.
PageNum
=
page
.
PageNum
;
}
else
{
this
.
PageNum
=
null
;
}
}
}
}
}
}
}
VIZ.Package.Module/Page/Group/ViewModel/PageGroupViewModel.cs
View file @
2968871b
...
@@ -261,7 +261,12 @@ namespace VIZ.Package.Module
...
@@ -261,7 +261,12 @@ namespace VIZ.Package.Module
if
(
DXMessageBox
.
Show
(
$"是否删除分组【
{
this
.
SelectedPageGroupModel
.
GroupName
}
】?"
,
"提示"
,
MessageBoxButton
.
YesNo
)
!=
MessageBoxResult
.
Yes
)
if
(
DXMessageBox
.
Show
(
$"是否删除分组【
{
this
.
SelectedPageGroupModel
.
GroupName
}
】?"
,
"提示"
,
MessageBoxButton
.
YesNo
)
!=
MessageBoxResult
.
Yes
)
return
;
return
;
PageGroupModel
group
=
this
.
SelectedPageGroupModel
;
this
.
PageGroupModels
.
Remove
(
this
.
SelectedPageGroupModel
);
this
.
PageGroupModels
.
Remove
(
this
.
SelectedPageGroupModel
);
PageGroupDeleteMessage
msg
=
new
PageGroupDeleteMessage
();
msg
.
PageGroup
=
group
;
ApplicationDomainEx
.
MessageManager
.
Send
(
msg
);
}
}
#
endregion
#
endregion
...
@@ -284,7 +289,12 @@ namespace VIZ.Package.Module
...
@@ -284,7 +289,12 @@ namespace VIZ.Package.Module
if
(
DXMessageBox
.
Show
(
$"是否删除项【
{
this
.
SelectedPageModel
.
Scene
}
】"
,
"提示"
,
MessageBoxButton
.
YesNo
)
!=
MessageBoxResult
.
Yes
)
if
(
DXMessageBox
.
Show
(
$"是否删除项【
{
this
.
SelectedPageModel
.
Scene
}
】"
,
"提示"
,
MessageBoxButton
.
YesNo
)
!=
MessageBoxResult
.
Yes
)
return
;
return
;
PageModel
page
=
this
.
SelectedPageModel
;
this
.
SelectedPageGroupModel
.
Pages
.
Remove
(
this
.
SelectedPageModel
);
this
.
SelectedPageGroupModel
.
Pages
.
Remove
(
this
.
SelectedPageModel
);
PageDeleteMessage
msg
=
new
PageDeleteMessage
();
msg
.
Page
=
page
;
ApplicationDomainEx
.
MessageManager
.
Send
(
msg
);
}
}
#
endregion
#
endregion
...
...
VIZ.Package.Module/Plugin/View/PluginView.xaml
View file @
2968871b
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
</dxmvvm:Interaction.Behaviors>
</dxmvvm:Interaction.Behaviors>
<Grid>
<Grid>
<fcommon:NavigationControl ItemsSource="{Binding ItemsSource}"
<fcommon:NavigationControl ItemsSource="{Binding ItemsSource}"
CreateMode="RealTime"
SelectedValue="{Binding Path=SelectedValue,Mode=OneWay}"></fcommon:NavigationControl>
SelectedValue="{Binding Path=SelectedValue,Mode=OneWay}"></fcommon:NavigationControl>
</Grid>
</Grid>
</UserControl>
</UserControl>
VIZ.Package.Module/Plugin/ViewModel/PluginViewModel.cs
View file @
2968871b
...
@@ -52,6 +52,8 @@ namespace VIZ.Package.Module
...
@@ -52,6 +52,8 @@ namespace VIZ.Package.Module
{
{
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectCloseMessage
>(
this
,
this
.
OnProjectCloseMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
ProjectCloseMessage
>(
this
,
this
.
OnProjectCloseMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
PageInitedMessage
>(
this
,
this
.
OnPageInitedMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
PageInitedMessage
>(
this
,
this
.
OnPageInitedMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
PageDeleteMessage
>(
this
,
this
.
OnPageDeleteMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
PageGroupDeleteMessage
>(
this
,
this
.
OnPageGroupDeleteMessage
);
}
}
// ========================================================================
// ========================================================================
...
@@ -192,6 +194,41 @@ namespace VIZ.Package.Module
...
@@ -192,6 +194,41 @@ namespace VIZ.Package.Module
this
.
SelectedValue
=
config
;
this
.
SelectedValue
=
config
;
}
}
/// <summary>
/// 页删除消息
/// </summary>
/// <param name="msg">消息</param>
private
void
OnPageDeleteMessage
(
PageDeleteMessage
msg
)
{
if
(
msg
.
Page
==
null
)
return
;
PluginNavigationConfig
config
=
this
.
ItemsSource
.
FirstOrDefault
(
p
=>
p
.
PageModel
==
msg
.
Page
);
if
(
config
==
null
)
return
;
this
.
ItemsSource
.
Remove
(
config
);
}
/// <summary>
/// 页分组删除消息
/// </summary>
/// <param name="msg">消息</param>
private
void
OnPageGroupDeleteMessage
(
PageGroupDeleteMessage
msg
)
{
if
(
msg
.
PageGroup
==
null
||
msg
.
PageGroup
.
Pages
==
null
)
return
;
foreach
(
PageModel
page
in
msg
.
PageGroup
.
Pages
)
{
PluginNavigationConfig
config
=
this
.
ItemsSource
.
FirstOrDefault
(
p
=>
p
.
PageModel
==
page
);
if
(
config
==
null
)
continue
;
this
.
ItemsSource
.
Remove
(
config
);
}
}
// ========================================================================
// ========================================================================
// Public Function
// Public Function
// ========================================================================
// ========================================================================
...
...
VIZ.Package.Module/Setting/PluginMapping/View/PluginMappingSettingView.xaml
View file @
2968871b
...
@@ -69,6 +69,7 @@
...
@@ -69,6 +69,7 @@
<dxg:GridColumn Header="插件" FieldName="PluginID" AllowSorting="False" AllowColumnFiltering="False" Width="120" AllowResizing="False">
<dxg:GridColumn Header="插件" FieldName="PluginID" AllowSorting="False" AllowColumnFiltering="False" Width="120" AllowResizing="False">
<dxg:GridColumn.EditSettings>
<dxg:GridColumn.EditSettings>
<dxe:ComboBoxEditSettings ItemsSource="{Binding Path=PluginInfos}" IsTextEditable="False"
<dxe:ComboBoxEditSettings ItemsSource="{Binding Path=PluginInfos}" IsTextEditable="False"
SelectItemWithNullValue="True"
DisplayMember="Name" ValueMember="ID"></dxe:ComboBoxEditSettings>
DisplayMember="Name" ValueMember="ID"></dxe:ComboBoxEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
</dxg:GridColumn>
...
...
VIZ.Package.Module/Setting/PluginMapping/ViewModel/PluginMappingSettingViewModel.cs
View file @
2968871b
...
@@ -122,7 +122,13 @@ namespace VIZ.Package.Module
...
@@ -122,7 +122,13 @@ namespace VIZ.Package.Module
this
.
Mappings
=
list
;
this
.
Mappings
=
list
;
// 插件信息
// 插件信息
this
.
PluginInfos
=
ApplicationDomainEx
.
PluginInfos
.
Where
(
p
=>
p
.
PluginType
==
PluginType
.
Page
&&
p
.
Group
!=
ApplicationConstants
.
APPLICATION_GROUP_NAME
).
ToList
();
var
plugins
=
ApplicationDomainEx
.
PluginInfos
.
Where
(
p
=>
p
.
PluginType
==
PluginType
.
Page
&&
p
.
Group
!=
ApplicationConstants
.
APPLICATION_GROUP_NAME
&&
p
.
Group
==
ApplicationDomainEx
.
VizConfig
.
PluginGroup
).
ToList
();
plugins
.
Insert
(
0
,
PluginInfo
.
NONE
);
this
.
PluginInfos
=
plugins
;
}
}
#
endregion
#
endregion
...
...
VIZ.Package.Module/Task/PackageTask/View/PackageTaskView.xaml
View file @
2968871b
...
@@ -58,12 +58,17 @@
...
@@ -58,12 +58,17 @@
<dxe:TextEditSettings AcceptsReturn="False"></dxe:TextEditSettings>
<dxe:TextEditSettings AcceptsReturn="False"></dxe:TextEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
</dxg:GridColumn>
<dxg:GridColumn Header="更新间隔(秒)" FieldName="Interval" AllowResizing="False" Width="100">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings MaskType="Numeric" HorizontalContentAlignment="Left"></dxe:TextEditSettings>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn Header="预览更新时间" ReadOnly="True"
<dxg:GridColumn Header="预览更新时间" ReadOnly="True"
AllowResizing="False" Width="100">
AllowResizing="False" Width="100">
<dxg:GridColumn.CellTemplate>
<dxg:GridColumn.CellTemplate>
<DataTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Row.PreviewUpdateTime,StringFormat=hh:mm:ss}"
<TextBlock Text="{Binding Path=Row.PreviewUpdateTime,StringFormat=hh:mm:ss}"
VerticalAlignment="Center"></TextBlock>
VerticalAlignment="Center"
Margin="3,0,3,0"
></TextBlock>
</DataTemplate>
</DataTemplate>
</dxg:GridColumn.CellTemplate>
</dxg:GridColumn.CellTemplate>
</dxg:GridColumn>
</dxg:GridColumn>
...
@@ -72,7 +77,7 @@
...
@@ -72,7 +77,7 @@
<dxg:GridColumn.CellTemplate>
<dxg:GridColumn.CellTemplate>
<DataTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Row.TakeUpdateTime,StringFormat=hh:mm:ss}"
<TextBlock Text="{Binding Path=Row.TakeUpdateTime,StringFormat=hh:mm:ss}"
VerticalAlignment="Center"></TextBlock>
VerticalAlignment="Center"
Margin="3,0,3,0"
></TextBlock>
</DataTemplate>
</DataTemplate>
</dxg:GridColumn.CellTemplate>
</dxg:GridColumn.CellTemplate>
</dxg:GridColumn>
</dxg:GridColumn>
...
...
VIZ.Package.Module/Task/PackageTask/ViewModel/PackageTaskViewModel.cs
View file @
2968871b
...
@@ -7,6 +7,7 @@ using System.Collections.ObjectModel;
...
@@ -7,6 +7,7 @@ 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
System.Web.Hosting
;
using
VIZ.Framework.Core
;
using
VIZ.Framework.Core
;
using
VIZ.Package.Domain
;
using
VIZ.Package.Domain
;
using
VIZ.Package.Plugin
;
using
VIZ.Package.Plugin
;
...
@@ -29,6 +30,9 @@ namespace VIZ.Package.Module
...
@@ -29,6 +30,9 @@ namespace VIZ.Package.Module
// 初始化命令
// 初始化命令
this
.
InitCommand
();
this
.
InitCommand
();
// 初始化消息
this
.
InitMessage
();
// 注册服务
// 注册服务
ApplicationDomainEx
.
ServiceManager
.
AddService
(
ViewServiceKeys
.
PACKAGE_TASK_SERVICE
,
this
);
ApplicationDomainEx
.
ServiceManager
.
AddService
(
ViewServiceKeys
.
PACKAGE_TASK_SERVICE
,
this
);
}
}
...
@@ -42,6 +46,15 @@ namespace VIZ.Package.Module
...
@@ -42,6 +46,15 @@ namespace VIZ.Package.Module
this
.
StopCommand
=
new
VCommand
<
PackageTaskModel
>(
this
.
Stop
);
this
.
StopCommand
=
new
VCommand
<
PackageTaskModel
>(
this
.
Stop
);
}
}
/// <summary>
/// 初始化消息
/// </summary>
private
void
InitMessage
()
{
ApplicationDomainEx
.
MessageManager
.
Register
<
PageDeleteMessage
>(
this
,
this
.
OnPageDeleteMessage
);
ApplicationDomainEx
.
MessageManager
.
Register
<
PageGroupDeleteMessage
>(
this
,
this
.
OnPageGroupDeleteMessage
);
}
// ==============================================================
// ==============================================================
// Service & Controller
// Service & Controller
// ==============================================================
// ==============================================================
...
@@ -115,6 +128,45 @@ namespace VIZ.Package.Module
...
@@ -115,6 +128,45 @@ namespace VIZ.Package.Module
#
endregion
#
endregion
// ==============================================================
// ==============================================================
// Message
// ==============================================================
/// <summary>
/// 页删除消息
/// </summary>
/// <param name="msg">消息</param>
private
void
OnPageDeleteMessage
(
PageDeleteMessage
msg
)
{
if
(
msg
.
Page
==
null
)
return
;
var
query
=
this
.
ItemsSource
.
Where
(
p
=>
p
.
PageModel
==
msg
.
Page
).
ToList
();
foreach
(
PackageTaskModel
task
in
query
)
{
this
.
Cancel
(
task
);
}
}
/// <summary>
/// 页分组删除消息
/// </summary>
/// <param name="msg">消息</param>
private
void
OnPageGroupDeleteMessage
(
PageGroupDeleteMessage
msg
)
{
if
(
msg
.
PageGroup
==
null
||
msg
.
PageGroup
.
Pages
==
null
)
return
;
foreach
(
PageModel
page
in
msg
.
PageGroup
.
Pages
)
{
var
query
=
this
.
ItemsSource
.
Where
(
p
=>
p
.
PageModel
==
page
).
ToList
();
foreach
(
PackageTaskModel
task
in
query
)
{
this
.
Cancel
(
task
);
}
}
}
// ==============================================================
// Public Function
// Public Function
// ==============================================================
// ==============================================================
...
@@ -129,7 +181,11 @@ namespace VIZ.Package.Module
...
@@ -129,7 +181,11 @@ namespace VIZ.Package.Module
if
(
this
.
ItemsSource
.
Contains
(
task
))
if
(
this
.
ItemsSource
.
Contains
(
task
))
return
;
return
;
IPluginService
pluginService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPluginService
>(
ViewServiceKeys
.
PLUGIN_SERVICE
);
task
.
PageModel
=
pluginService
.
GetPageModelFromView
(
task
.
View
);
this
.
ItemsSource
.
Add
(
task
);
this
.
ItemsSource
.
Add
(
task
);
}
string
key
=
$"PackageTask_
{
task
.
ID
}
"
;
string
key
=
$"PackageTask_
{
task
.
ID
}
"
;
task
.
TimerInfo
=
ApplicationDomainEx
.
TimerManager
.
Register
(
key
,
task
.
Interval
,
()
=>
task
.
TimerInfo
=
ApplicationDomainEx
.
TimerManager
.
Register
(
key
,
task
.
Interval
,
()
=>
...
@@ -143,7 +199,7 @@ namespace VIZ.Package.Module
...
@@ -143,7 +199,7 @@ namespace VIZ.Package.Module
{
{
try
try
{
{
task
.
PreviewUpdateAction
(
ApplicationDomainEx
.
PreviewConn
);
task
.
PreviewUpdateAction
?.
Invoke
(
ApplicationDomainEx
.
PreviewConn
);
WPFHelper
.
Invoke
(()
=>
WPFHelper
.
Invoke
(()
=>
{
{
task
.
PreviewUpdateTime
=
DateTime
.
Now
;
task
.
PreviewUpdateTime
=
DateTime
.
Now
;
...
@@ -162,15 +218,7 @@ namespace VIZ.Package.Module
...
@@ -162,15 +218,7 @@ namespace VIZ.Package.Module
// 上版
// 上版
if
(
task
.
IsTakeEnabled
)
if
(
task
.
IsTakeEnabled
)
{
{
IPluginService
pluginService
=
ApplicationDomainEx
.
ServiceManager
.
GetService
<
IPluginService
>(
ViewServiceKeys
.
PLUGIN_SERVICE
);
ConnGroupModel
group
=
ApplicationDomainEx
.
ConnGroups
.
FirstOrDefault
(
p
=>
p
.
GroupID
==
task
.
PageModel
.
ConnGroupID
);
if
(
pluginService
==
null
)
return
;
PageModel
page
=
pluginService
.
GetPageModelFromView
(
task
.
View
);
if
(
page
==
null
)
return
;
ConnGroupModel
group
=
ApplicationDomainEx
.
ConnGroups
.
FirstOrDefault
(
p
=>
p
.
GroupID
==
page
.
ConnGroupID
);
if
(
group
==
null
)
if
(
group
==
null
)
return
;
return
;
...
@@ -199,7 +247,6 @@ namespace VIZ.Package.Module
...
@@ -199,7 +247,6 @@ namespace VIZ.Package.Module
}
}
});
});
}
}
}
/// <summary>
/// <summary>
/// 取消任务
/// 取消任务
...
...
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