Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.TimeSlice
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.TimeSlice
Commits
d50fa932
Commit
d50fa932
authored
Oct 26, 2022
by
liulongfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加刷新配置按钮
parent
d9cbd1db
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
77 additions
and
4 deletions
+77
-4
VIZ.TimeSlice.Module.Resource/VIZ.TimeSlice.Module.Resource.csproj
+1
-0
VIZ.TimeSlice.Module.Resource/app.config
+12
-0
VIZ.TimeSlice.Module/MainView/View/MainView.xaml
+6
-1
VIZ.TimeSlice.Module/MainView/ViewModel/MainViewModel.cs
+47
-0
VIZ.TimeSlice.Storage/Ini/Config/ClientConfig.cs
+6
-0
VIZ.TimeSlice/MainWindow.xaml
+1
-1
VIZ.TimeSlice/config/config.ini
+4
-2
No files found.
VIZ.TimeSlice.Module.Resource/VIZ.TimeSlice.Module.Resource.csproj
View file @
d50fa932
...
@@ -95,6 +95,7 @@
...
@@ -95,6 +95,7 @@
<Generator>ResXFileCodeGenerator</Generator>
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</EmbeddedResource>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<Generator>SettingsSingleFileGenerator</Generator>
...
...
VIZ.TimeSlice.Module.Resource/app.config
0 → 100644
View file @
d50fa932
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
runtime
>
<
assemblyBinding
xmlns
=
"urn:schemas-microsoft-com:asm.v1"
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"System.Runtime.CompilerServices.Unsafe"
publicKeyToken
=
"b03f5f7f11d50a3a"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-4.0.4.1"
newVersion
=
"4.0.4.1"
/>
</
dependentAssembly
>
</
assemblyBinding
>
</
runtime
>
</
configuration
>
\ No newline at end of file
VIZ.TimeSlice.Module/MainView/View/MainView.xaml
View file @
d50fa932
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
xmlns:resource="clr-namespace:VIZ.TimeSlice.Module.Resource;assembly=VIZ.TimeSlice.Module.Resource"
xmlns:resource="clr-namespace:VIZ.TimeSlice.Module.Resource;assembly=VIZ.TimeSlice.Module.Resource"
mc:Ignorable="d" d:Background="White"
mc:Ignorable="d" d:Background="White"
d:DataContext="{d:DesignInstance Type=local:MainViewModel}"
d:DataContext="{d:DesignInstance Type=local:MainViewModel}"
d:DesignHeight="8
0
0" d:DesignWidth="800">
d:DesignHeight="8
2
0" d:DesignWidth="800">
<UserControl.Resources>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary>
<resource:PullMessageUrlConverter x:Key="PullMessageUrlConverter"></resource:PullMessageUrlConverter>
<resource:PullMessageUrlConverter x:Key="PullMessageUrlConverter"></resource:PullMessageUrlConverter>
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
</Grid.RowDefinitions>
</Grid.RowDefinitions>
<!-- 工作目录 -->
<!-- 工作目录 -->
<Grid Grid.Row="0">
<Grid Grid.Row="0">
...
@@ -170,6 +171,10 @@
...
@@ -170,6 +171,10 @@
</ComboBox>
</ComboBox>
</Grid>
</Grid>
<!-- 刷新配置 -->
<Button Grid.Row="5" Width="120" Height="30" HorizontalAlignment="Right" Content="刷新配置"
Command="{Binding RefreshCommand,Mode=OneWay}"></Button>
</Grid>
</Grid>
</GroupBox>
</GroupBox>
...
...
VIZ.TimeSlice.Module/MainView/ViewModel/MainViewModel.cs
View file @
d50fa932
...
@@ -40,6 +40,7 @@ namespace VIZ.TimeSlice.Module
...
@@ -40,6 +40,7 @@ namespace VIZ.TimeSlice.Module
this
.
SelectWorkPathCommand
=
new
VCommand
(
this
.
SelectWorkPath
);
this
.
SelectWorkPathCommand
=
new
VCommand
(
this
.
SelectWorkPath
);
this
.
SelectBackgroundImagePathCommand
=
new
VCommand
(
this
.
SelectBackgroundImagePath
);
this
.
SelectBackgroundImagePathCommand
=
new
VCommand
(
this
.
SelectBackgroundImagePath
);
this
.
SelectDestPathCommand
=
new
VCommand
(
this
.
SelectDestPath
);
this
.
SelectDestPathCommand
=
new
VCommand
(
this
.
SelectDestPath
);
this
.
RefreshCommand
=
new
VCommand
(
this
.
Refresh
);
}
}
/// <summary>
/// <summary>
...
@@ -390,6 +391,11 @@ namespace VIZ.TimeSlice.Module
...
@@ -390,6 +391,11 @@ namespace VIZ.TimeSlice.Module
/// </summary>
/// </summary>
private
readonly
static
string
CLIENT_PULL_MESSAGE_URL
=
ApplicationDomainEx
.
IniStorage
.
GetValue
<
ClientConfig
,
string
>(
p
=>
p
.
CLIENT_PULL_MESSAGE_URL
);
private
readonly
static
string
CLIENT_PULL_MESSAGE_URL
=
ApplicationDomainEx
.
IniStorage
.
GetValue
<
ClientConfig
,
string
>(
p
=>
p
.
CLIENT_PULL_MESSAGE_URL
);
/// <summary>
/// 刷新配置地址
/// </summary>
private
readonly
static
string
CLIENT_REFRESH_INI_CONFIG_URL
=
ApplicationDomainEx
.
IniStorage
.
GetValue
<
ClientConfig
,
string
>(
p
=>
p
.
CLIENT_REFRESH_INI_CONFIG_URL
);
// ==========================================================
// ==========================================================
// Commond
// Commond
// ==========================================================
// ==========================================================
...
@@ -506,6 +512,47 @@ namespace VIZ.TimeSlice.Module
...
@@ -506,6 +512,47 @@ namespace VIZ.TimeSlice.Module
#
endregion
#
endregion
#
region
RefreshCommand
--
刷新配置命令
/// <summary>
/// 刷新配置命令
/// </summary>
public
VCommand
RefreshCommand
{
get
;
set
;
}
/// <summary>
/// 刷新配置
/// </summary>
private
void
Refresh
()
{
this
.
IsStartButtonEnabled
=
false
;
Task
.
Run
(()
=>
{
try
{
string
url
=
CLIENT_REFRESH_INI_CONFIG_URL
;
this
.
LogString
=
$"
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
-- HTTP请求:
{
url
}
"
;
string
result
=
HttpHelper
.
Get
(
url
,
null
);
this
.
LogString
=
$"
{
this
.
LogString
}
\r\n
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
-- 返回:
{
result
}
"
;
}
catch
(
Exception
ex
)
{
log
.
Error
(
ex
);
this
.
LogString
=
$"
{
this
.
LogString
}
\r\n
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
-- 异常:
{
ex
.
Message
}
"
;
}
finally
{
this
.
IsStartButtonEnabled
=
true
;
}
});
}
#
endregion
// ==========================================================
// ==========================================================
// Private Function
// Private Function
// ==========================================================
// ==========================================================
...
...
VIZ.TimeSlice.Storage/Ini/Config/ClientConfig.cs
View file @
d50fa932
...
@@ -17,5 +17,11 @@ namespace VIZ.TimeSlice.Storage
...
@@ -17,5 +17,11 @@ namespace VIZ.TimeSlice.Storage
/// </summary>
/// </summary>
[
Ini
(
Section
=
"Client"
,
DefaultValue
=
"http://localhost:8888/olympic/pull/message?status=1&path={path}"
,
Type
=
typeof
(
string
))]
[
Ini
(
Section
=
"Client"
,
DefaultValue
=
"http://localhost:8888/olympic/pull/message?status=1&path={path}"
,
Type
=
typeof
(
string
))]
public
string
CLIENT_PULL_MESSAGE_URL
{
get
;
set
;
}
public
string
CLIENT_PULL_MESSAGE_URL
{
get
;
set
;
}
/// <summary>
/// 刷新配置地址
/// </summary>
[
Ini
(
Section
=
"Client"
,
DefaultValue
=
"http://localhost:8888/olympic/update-config/message"
,
Type
=
typeof
(
string
))]
public
string
CLIENT_REFRESH_INI_CONFIG_URL
{
get
;
set
;
}
}
}
}
}
VIZ.TimeSlice/MainWindow.xaml
View file @
d50fa932
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
xmlns:local="clr-namespace:VIZ.TimeSlice"
xmlns:local="clr-namespace:VIZ.TimeSlice"
mc:Ignorable="d" WindowStartupLocation="CenterScreen"
mc:Ignorable="d" WindowStartupLocation="CenterScreen"
Icon="icon.ico"
Icon="icon.ico"
Title="时间切片工具" Height="8
00" Width="800" MinWidth="800" MinHeight="80
0">
Title="时间切片工具" Height="8
60" Width="800" MinWidth="800" MinHeight="86
0">
<Grid>
<Grid>
<module:MainView></module:MainView>
<module:MainView></module:MainView>
</Grid>
</Grid>
...
...
VIZ.TimeSlice/config/config.ini
View file @
d50fa932
...
@@ -27,4 +27,6 @@ format=mp4
...
@@ -27,4 +27,6 @@ format=mp4
; ============================================================
; ============================================================
[Client]
[Client]
; 推送消息地址
; 推送消息地址
CLIENT_PULL_MESSAGE_URL
=
http://localhost:8888/olympic/pull/message?status=1&path={path}
CLIENT_PULL_MESSAGE_URL
=
http://localhost:8888/olympic/pull/message?status=1&path={path}
\ No newline at end of file
; 刷新配置地址
CLIENT_REFRESH_INI_CONFIG_URL
=
http://localhost:8888/olympic/update-config/message
\ No newline at end of file
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