Skip to content

Commit 1eaaeb0

Browse files
committed
Started Confidential mode implementation (#667)
1 parent fc6fdb1 commit 1eaaeb0

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
MIT License
3+
4+
Copyright (c) Léo Corporation
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+
*/
24+
namespace InternetTest.Interfaces;
25+
public interface ISensitiveViewModel
26+
{
27+
internal void ToggleConfidentialMode(bool confidentialMode);
28+
}

InternetTest/InternetTest/ViewModels/HomePageViewModel.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
SOFTWARE.
2323
*/
2424
using InternetTest.Helpers;
25+
using InternetTest.Interfaces;
2526
using InternetTest.Models;
2627
using PeyrSharp.Core;
2728
using System.Net.NetworkInformation;
29+
using System.Windows;
2830
using System.Windows.Media;
2931

3032
namespace InternetTest.ViewModels;
3133

32-
public class HomePageViewModel : ViewModelBase
34+
public class HomePageViewModel : ViewModelBase, ISensitiveViewModel
3335
{
3436
public string HelloText => DateTime.Now.Hour switch
3537
{
@@ -148,4 +150,9 @@ internal async void LoadStatusCard()
148150
>= 25 => "\uF8B1",
149151
_ => "\uF8B3"
150152
};
153+
154+
void ISensitiveViewModel.ToggleConfidentialMode(bool confidentialMode)
155+
{
156+
//TODO
157+
}
151158
}

InternetTest/InternetTest/ViewModels/MainViewModel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2424
using InternetTest.Commands;
2525
using InternetTest.Enums;
2626
using InternetTest.Helpers;
27+
using InternetTest.Interfaces;
2728
using InternetTest.Models;
2829
using InternetTest.ViewModels.Components;
2930
using System.Windows;
@@ -75,6 +76,8 @@ public bool ConfidentialMode
7576
_confidentialMode = value;
7677
ConfidentialTooltip = value ? Properties.Resources.DisableConfidential : Properties.Resources.EnableConfidential;
7778

79+
if (CurrentViewModel is ISensitiveViewModel sensitiveViewModel) sensitiveViewModel.ToggleConfidentialMode(value);
80+
7881
OnPropertyChanged(nameof(ConfidentialMode));
7982
}
8083
}

0 commit comments

Comments
 (0)