Browse Source

chore: format cs with dotnet format

tags/0.1.0
TCL 3 years ago
parent
commit
f490e4d389
4 changed files with 45 additions and 32 deletions
  1. +1
    -1
      installer/Installer/AssemblyInfo.cs
  2. +14
    -7
      installer/Installer/Model.cs
  3. +29
    -23
      installer/Installer/ViewModel.cs
  4. +1
    -1
      launcher/Launcher/AssemblyInfo.cs

+ 1
- 1
installer/Installer/AssemblyInfo.cs View File

@@ -1,6 +1,6 @@
using System.Windows;

[assembly:ThemeInfo(
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, // where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)


+ 14
- 7
installer/Installer/Model.cs View File

@@ -26,15 +26,21 @@ namespace starter.viewmodel.settings
/// <summary>
/// Route of files
/// </summary>
public string Route {
get; set; }
public string Route
{
get; set;
}
/// <summary>
/// if the route was set or is under editing
/// </summary>
public bool HaveRoute {
get; set; }
public bool EditingRoute {
get; set; }
public bool HaveRoute
{
get; set;
}
public bool EditingRoute
{
get; set;
}
/// <summary>
/// downloader function
/// </summary>
@@ -144,7 +150,8 @@ namespace Downloader
GetObjectRequest request = new GetObjectRequest(bucket, key, localDir, localFileName);

Dictionary<string, string> test = request.GetRequestHeaders();
request.SetCosProgressCallback(delegate(long completed, long total) {
request.SetCosProgressCallback(delegate (long completed, long total)
{
Console.WriteLine(String.Format("progress = {0:##.##}%", completed * 100.0 / total));
});
// 执行请求


+ 29
- 23
installer/Installer/ViewModel.cs View File

@@ -22,10 +22,12 @@ namespace starter.viewmodel.settings

public string Route
{
get {
get
{
return obj.Route;
}
set {
set
{
obj.Route = value;
this.RaisePropertyChanged("Route");
}
@@ -33,10 +35,12 @@ namespace starter.viewmodel.settings

public bool CanEditRoute // if the user can still edit install route
{
get {
get
{
return !obj.HaveRoute;
}
set {
set
{
obj.HaveRoute = !value;
obj.EditingRoute = value;
this.RaisePropertyChanged("CanEditRoute");
@@ -46,7 +50,8 @@ namespace starter.viewmodel.settings
private BaseCommand clickBrowseCommand;
public BaseCommand ClickBrowseCommand
{
get {
get
{
if (clickBrowseCommand == null)
{
clickBrowseCommand = new BaseCommand(new Action<object>(o =>
@@ -54,28 +59,29 @@ namespace starter.viewmodel.settings
using (FolderBrowserDialog dialog = new FolderBrowserDialog())
{
_ = dialog.ShowDialog();
if (dialog.SelectedPath != String.Empty)
Route = dialog.SelectedPath;
if (dialog.SelectedPath != String.Empty)
Route = dialog.SelectedPath;
}
}));
}
}));
}
return clickBrowseCommand;
}
}
private BaseCommand clickConfirmCommand;
public BaseCommand ClickConfirmCommand
{
get {
if (clickConfirmCommand == null)
return clickBrowseCommand;
}
}
private BaseCommand clickConfirmCommand;
public BaseCommand ClickConfirmCommand
{
get
{
if (clickConfirmCommand == null)
{
clickConfirmCommand = new BaseCommand(new Action<object>(o =>
{
CanEditRoute = false;
obj.install();
}));
}
obj.install();
}));
}
return clickConfirmCommand;
}
}
}
}
}
}
}

+ 1
- 1
launcher/Launcher/AssemblyInfo.cs View File

@@ -1,6 +1,6 @@
using System.Windows;

[assembly:ThemeInfo(
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, // where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)


Loading…
Cancel
Save