Skip to content

Commit

Permalink
chore: format cs with dotnet format
Browse files Browse the repository at this point in the history
  • Loading branch information
TCL606 committed Nov 23, 2022
1 parent 7980529 commit f490e4d
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 32 deletions.
2 changes: 1 addition & 1 deletion installer/Installer/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
21 changes: 14 additions & 7 deletions installer/Installer/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,21 @@ public void install()
/// <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>
Expand Down Expand Up @@ -144,7 +150,8 @@ public void download(string download_dir, string key)
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));
});
// 执行请求
Expand Down
52 changes: 29 additions & 23 deletions installer/Installer/ViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,25 @@ public SettingsViewModel()

public string Route
{
get {
get
{
return obj.Route;
}
set {
set
{
obj.Route = value;
this.RaisePropertyChanged("Route");
}
}

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");
Expand All @@ -46,36 +50,38 @@ public string Route
private BaseCommand clickBrowseCommand;
public BaseCommand ClickBrowseCommand
{
get {
get
{
if (clickBrowseCommand == null)
{
clickBrowseCommand = new BaseCommand(new Action<object>(o =>
{
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;
}
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion launcher/Launcher/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit f490e4d

Please sign in to comment.