-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
117 additions
and
49 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/ImeSense.Launchers.Belarus.Core/Manager/ISplashScreenManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using ImeSense.Launchers.Belarus.Models; | ||
|
||
namespace ImeSense.Launchers.Belarus.Core.Manager; | ||
|
||
public interface ISplashScreenManager | ||
{ | ||
CancellationToken CancellationToken { get; } | ||
InformationMessage SplashScreenMessage { get; } | ||
int CurrentProgress { get; set; } | ||
int MaxProgress { get; set; } | ||
void UpdateInformation(InformationMessage splashScreenMessage); | ||
void Cancel(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/ImeSense.Launchers.Belarus.Core/Manager/SplashScreenManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using ImeSense.Launchers.Belarus.Models; | ||
|
||
using ReactiveUI; | ||
using ReactiveUI.Fody.Helpers; | ||
|
||
namespace ImeSense.Launchers.Belarus.Core.Manager; | ||
|
||
public class SplashScreenManager : ReactiveObject, ISplashScreenManager | ||
{ | ||
private readonly CancellationTokenSource _cts = new(); | ||
|
||
public CancellationToken CancellationToken { get; } | ||
[Reactive] public InformationMessage SplashScreenMessage { get; private set; } | ||
[Reactive] public int CurrentProgress { get; set; } = 0; | ||
public int MaxProgress { get; set; } | ||
|
||
public SplashScreenManager() | ||
{ | ||
CancellationToken = _cts.Token; | ||
SplashScreenMessage = new InformationMessage("Title", "Description"); | ||
} | ||
|
||
public void Cancel() | ||
{ | ||
_cts.Cancel(); | ||
} | ||
|
||
public void UpdateInformation(InformationMessage splashScreenMessage) | ||
{ | ||
CurrentProgress++; | ||
SplashScreenMessage = splashScreenMessage; | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/ImeSense.Launchers.Belarus.Core/Models/InformationMessage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace ImeSense.Launchers.Belarus.Models; | ||
|
||
public record struct InformationMessage(string Title, string Description); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters