parent
2cf6d61273
commit
14372d1e00
21
App.xaml.cs
21
App.xaml.cs
|
|
@ -42,20 +42,15 @@ namespace HeBianGu.App.Disk
|
||||||
var setting = xmlSerializerService.Load<SystemSetting>("./settings.xml");
|
var setting = xmlSerializerService.Load<SystemSetting>("./settings.xml");
|
||||||
if (!string.IsNullOrEmpty(setting.SyncDir))
|
if (!string.IsNullOrEmpty(setting.SyncDir))
|
||||||
{
|
{
|
||||||
if (setting.TaskCount == 0 )
|
if (setting.TaskCount == 0)
|
||||||
{
|
{
|
||||||
setting.TaskCount = 3;
|
setting.TaskCount = 3;
|
||||||
}
|
}
|
||||||
minioService.MirrorAsync1(bucketName, setting.SyncDir, setting.TaskCount);
|
//minioService.MirrorAsync1(bucketName, setting.SyncDir, setting.TaskCount);
|
||||||
minioService.RealTimeListen(bucketName, setting.SyncDir);
|
minioService.RealTimeListen(bucketName, setting.SyncDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
services.AddStart(x =>
|
|
||||||
{
|
|
||||||
x.ProductFontSize = 90;
|
|
||||||
x.Title = "数据同步";
|
|
||||||
x.Copyright = "";
|
|
||||||
});
|
|
||||||
services.AddWindowDialog();
|
services.AddWindowDialog();
|
||||||
services.AddObjectWindowDialog();
|
services.AddObjectWindowDialog();
|
||||||
services.AddWindowAnimation();
|
services.AddWindowAnimation();
|
||||||
|
|
@ -139,9 +134,7 @@ namespace HeBianGu.App.Disk
|
||||||
protected override void Configure(IApplicationBuilder app)
|
protected override void Configure(IApplicationBuilder app)
|
||||||
{
|
{
|
||||||
base.Configure(app);
|
base.Configure(app);
|
||||||
app.UseSetting(x => {
|
app.UseSetting(x => { x.Settings.Add(MySetting.Instance); });
|
||||||
x.Settings.Add(MySetting.Instance);
|
|
||||||
});
|
|
||||||
app.UseStyle();
|
app.UseStyle();
|
||||||
//app.UseSettingDefault();
|
//app.UseSettingDefault();
|
||||||
// Do:设置默认主题
|
// Do:设置默认主题
|
||||||
|
|
@ -154,7 +147,7 @@ namespace HeBianGu.App.Disk
|
||||||
l.ItemHeight = 35;
|
l.ItemHeight = 35;
|
||||||
//l.ItemWidth = 120;
|
//l.ItemWidth = 120;
|
||||||
l.ItemCornerRadius = 5;
|
l.ItemCornerRadius = 5;
|
||||||
l.AnimalSpeed = 100;
|
l.AnimalSpeed = 300;
|
||||||
l.AccentColorSelectType = 0;
|
l.AccentColorSelectType = 0;
|
||||||
l.IsUseAnimal = false;
|
l.IsUseAnimal = false;
|
||||||
l.ThemeType = ThemeType.DarkBlack;
|
l.ThemeType = ThemeType.DarkBlack;
|
||||||
|
|
@ -164,10 +157,12 @@ namespace HeBianGu.App.Disk
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Displayer(Name = "关机设置", GroupName = "是否关机")]
|
[Displayer(Name = "关机设置", GroupName = "是否关机")]
|
||||||
public class MySetting:LazySettingInstance<MySetting>
|
public class MySetting : LazySettingInstance<MySetting>
|
||||||
{
|
{
|
||||||
private bool _ison;
|
private bool _ison;
|
||||||
|
|
||||||
[DefaultValue(false)]
|
[DefaultValue(false)]
|
||||||
[Display(Name = "是否上传完成关机")]
|
[Display(Name = "是否上传完成关机")]
|
||||||
public bool IsOn
|
public bool IsOn
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ namespace Hopetry.Services
|
||||||
public async Task MirrorAsync1(string bucket, string localDir, int maxParallel = 5)
|
public async Task MirrorAsync1(string bucket, string localDir, int maxParallel = 5)
|
||||||
{
|
{
|
||||||
Channel<(string ObjectName, string ETag)> SyncChannel = Channel.CreateBounded<(string, string)>(
|
Channel<(string ObjectName, string ETag)> SyncChannel = Channel.CreateBounded<(string, string)>(
|
||||||
new BoundedChannelOptions(10000)
|
new BoundedChannelOptions(1000)
|
||||||
{
|
{
|
||||||
SingleWriter = false,
|
SingleWriter = false,
|
||||||
SingleReader = false,
|
SingleReader = false,
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,6 @@
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</h:Row>
|
</h:Row>
|
||||||
<h:Row>
|
<h:Row>
|
||||||
|
|
||||||
</h:Row>
|
</h:Row>
|
||||||
<h:Row>
|
<h:Row>
|
||||||
<ComboBox Width="250" h:Cattach.Title="同时下载"
|
<ComboBox Width="250" h:Cattach.Title="同时下载"
|
||||||
|
|
@ -122,6 +121,8 @@
|
||||||
<system:Int32>5</system:Int32>
|
<system:Int32>5</system:Int32>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</h:Row>
|
</h:Row>
|
||||||
|
<h:Row>
|
||||||
|
</h:Row>
|
||||||
<h:Row>
|
<h:Row>
|
||||||
<Button Margin="0 5 0 5" Content="立即同步一次" HorizontalAlignment="Left" Width="150"
|
<Button Margin="0 5 0 5" Content="立即同步一次" HorizontalAlignment="Left" Width="150"
|
||||||
Style="{DynamicResource {x:Static h:ButtonKeys.Accent}}"
|
Style="{DynamicResource {x:Static h:ButtonKeys.Accent}}"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue