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; using System.Windows;


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


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

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


Dictionary<string, string> test = request.GetRequestHeaders(); 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)); 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 public string Route
{ {
get {
get
{
return obj.Route; return obj.Route;
} }
set {
set
{
obj.Route = value; obj.Route = value;
this.RaisePropertyChanged("Route"); this.RaisePropertyChanged("Route");
} }
@@ -33,10 +35,12 @@ namespace starter.viewmodel.settings


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

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

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


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


Loading…
Cancel
Save