Archived
1
0

Implemented incognito mode

This commit is contained in:
Michael Gordeev
2020-05-14 00:03:21 +03:00
parent d25bc92188
commit 8159d33a43
3 changed files with 34 additions and 2 deletions
+4 -2
View File
@@ -54,11 +54,13 @@ namespace FoxTube
public static Userinfoplus[] Users { get; private set; } = new Userinfoplus[MaxUsersCount];
public static bool IncognitoMode { get; set; } = false;
public static bool CanAddAccounts => Users.Any(i => i == null);
public static User CurrentUser { get; set; }
public static bool Authorized => CurrentUser != null;
public static ExtendedYouTubeService Service => CurrentUser?.Service ?? _defaultService;
public static YoutubeClient YoutubeClient => CurrentUser?.Client ?? _defaultYteClient;
public static ExtendedYouTubeService Service => IncognitoMode ? _defaultService : (CurrentUser?.Service ?? _defaultService);
public static YoutubeClient YoutubeClient => IncognitoMode ? _defaultYteClient : (CurrentUser?.Client ?? _defaultYteClient);
public static event EventHandler<bool> UserStateUpdated;
public static event EventHandler<Subscription> SubscriptionsChanged;