mirror of
https://github.com/bitwarden/mobile
synced 2025-12-15 15:53:44 +00:00
Changed all C# control flow block statements to include space between keyword and open paren (#800)
This commit is contained in:
@@ -134,16 +134,16 @@ namespace Bit.App.Pages
|
||||
|
||||
public async Task LoadAsync()
|
||||
{
|
||||
if(_doingLoad)
|
||||
if (_doingLoad)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var authed = await _userService.IsAuthenticatedAsync();
|
||||
if(!authed)
|
||||
if (!authed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(await _lockService.IsLockedAsync())
|
||||
if (await _lockService.IsLockedAsync())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -161,7 +161,7 @@ namespace Bit.App.Pages
|
||||
try
|
||||
{
|
||||
await LoadDataAsync();
|
||||
if(ShowNoFolderCiphers && (NestedFolders?.Any() ?? false))
|
||||
if (ShowNoFolderCiphers && (NestedFolders?.Any() ?? false))
|
||||
{
|
||||
// Remove "No Folder" from folder listing
|
||||
NestedFolders = NestedFolders.GetRange(0, NestedFolders.Count - 1);
|
||||
@@ -169,13 +169,13 @@ namespace Bit.App.Pages
|
||||
|
||||
var uppercaseGroupNames = _deviceActionService.DeviceType == DeviceType.iOS;
|
||||
var hasFavorites = FavoriteCiphers?.Any() ?? false;
|
||||
if(hasFavorites)
|
||||
if (hasFavorites)
|
||||
{
|
||||
var favListItems = FavoriteCiphers.Select(c => new GroupingsPageListItem { Cipher = c }).ToList();
|
||||
groupedItems.Add(new GroupingsPageListGroup(favListItems, AppResources.Favorites,
|
||||
favListItems.Count, uppercaseGroupNames, true));
|
||||
}
|
||||
if(MainPage)
|
||||
if (MainPage)
|
||||
{
|
||||
groupedItems.Add(new GroupingsPageListGroup(
|
||||
AppResources.Types, 4, uppercaseGroupNames, !hasFavorites)
|
||||
@@ -206,7 +206,7 @@ namespace Bit.App.Pages
|
||||
},
|
||||
});
|
||||
}
|
||||
if(NestedFolders?.Any() ?? false)
|
||||
if (NestedFolders?.Any() ?? false)
|
||||
{
|
||||
var folderListItems = NestedFolders.Select(f =>
|
||||
{
|
||||
@@ -220,7 +220,7 @@ namespace Bit.App.Pages
|
||||
groupedItems.Add(new GroupingsPageListGroup(folderListItems, AppResources.Folders,
|
||||
folderListItems.Count, uppercaseGroupNames, !MainPage));
|
||||
}
|
||||
if(NestedCollections?.Any() ?? false)
|
||||
if (NestedCollections?.Any() ?? false)
|
||||
{
|
||||
var collectionListItems = NestedCollections.Select(c => new GroupingsPageListItem
|
||||
{
|
||||
@@ -231,13 +231,13 @@ namespace Bit.App.Pages
|
||||
groupedItems.Add(new GroupingsPageListGroup(collectionListItems, AppResources.Collections,
|
||||
collectionListItems.Count, uppercaseGroupNames, !MainPage));
|
||||
}
|
||||
if(Ciphers?.Any() ?? false)
|
||||
if (Ciphers?.Any() ?? false)
|
||||
{
|
||||
var ciphersListItems = Ciphers.Select(c => new GroupingsPageListItem { Cipher = c }).ToList();
|
||||
groupedItems.Add(new GroupingsPageListGroup(ciphersListItems, AppResources.Items,
|
||||
ciphersListItems.Count, uppercaseGroupNames, !MainPage && !groupedItems.Any()));
|
||||
}
|
||||
if(ShowNoFolderCiphers)
|
||||
if (ShowNoFolderCiphers)
|
||||
{
|
||||
var noFolderCiphersListItems = NoFolderCiphers.Select(
|
||||
c => new GroupingsPageListItem { Cipher = c }).ToList();
|
||||
@@ -266,7 +266,7 @@ namespace Bit.App.Pages
|
||||
public async Task SelectTypeAsync(CipherType type)
|
||||
{
|
||||
string title = null;
|
||||
switch(type)
|
||||
switch (type)
|
||||
{
|
||||
case CipherType.Login:
|
||||
title = AppResources.Logins;
|
||||
@@ -303,7 +303,7 @@ namespace Bit.App.Pages
|
||||
{
|
||||
var confirmed = await _platformUtilsService.ShowDialogAsync(AppResources.ExitConfirmation,
|
||||
AppResources.Exit, AppResources.Yes, AppResources.Cancel);
|
||||
if(confirmed)
|
||||
if (confirmed)
|
||||
{
|
||||
_messagingService.Send("exit");
|
||||
}
|
||||
@@ -311,7 +311,7 @@ namespace Bit.App.Pages
|
||||
|
||||
public async Task SyncAsync()
|
||||
{
|
||||
if(Xamarin.Essentials.Connectivity.NetworkAccess == Xamarin.Essentials.NetworkAccess.None)
|
||||
if (Xamarin.Essentials.Connectivity.NetworkAccess == Xamarin.Essentials.NetworkAccess.None)
|
||||
{
|
||||
await _platformUtilsService.ShowDialogAsync(AppResources.InternetConnectionRequiredMessage,
|
||||
AppResources.InternetConnectionRequiredTitle);
|
||||
@@ -345,7 +345,7 @@ namespace Bit.App.Pages
|
||||
HasCollections = false;
|
||||
Filter = null;
|
||||
|
||||
if(MainPage)
|
||||
if (MainPage)
|
||||
{
|
||||
Folders = await _folderService.GetAllDecryptedAsync();
|
||||
NestedFolders = await _folderService.GetAllNestedAsync();
|
||||
@@ -356,18 +356,18 @@ namespace Bit.App.Pages
|
||||
}
|
||||
else
|
||||
{
|
||||
if(Type != null)
|
||||
if (Type != null)
|
||||
{
|
||||
Filter = c => c.Type == Type.Value;
|
||||
}
|
||||
else if(FolderId != null)
|
||||
else if (FolderId != null)
|
||||
{
|
||||
NoDataText = AppResources.NoItemsFolder;
|
||||
var folderId = FolderId == "none" ? null : FolderId;
|
||||
if(folderId != null)
|
||||
if (folderId != null)
|
||||
{
|
||||
var folderNode = await _folderService.GetNestedAsync(folderId);
|
||||
if(folderNode?.Node != null)
|
||||
if (folderNode?.Node != null)
|
||||
{
|
||||
PageTitle = folderNode.Node.Name;
|
||||
NestedFolders = (folderNode.Children?.Count ?? 0) > 0 ? folderNode.Children : null;
|
||||
@@ -379,12 +379,12 @@ namespace Bit.App.Pages
|
||||
}
|
||||
Filter = c => c.FolderId == folderId;
|
||||
}
|
||||
else if(CollectionId != null)
|
||||
else if (CollectionId != null)
|
||||
{
|
||||
ShowAddCipherButton = false;
|
||||
NoDataText = AppResources.NoItemsCollection;
|
||||
var collectionNode = await _collectionService.GetNestedAsync(CollectionId);
|
||||
if(collectionNode?.Node != null)
|
||||
if (collectionNode?.Node != null)
|
||||
{
|
||||
PageTitle = collectionNode.Node.Name;
|
||||
NestedCollections = (collectionNode.Children?.Count ?? 0) > 0 ? collectionNode.Children : null;
|
||||
@@ -398,28 +398,28 @@ namespace Bit.App.Pages
|
||||
Ciphers = Filter != null ? _allCiphers.Where(Filter).ToList() : _allCiphers;
|
||||
}
|
||||
|
||||
foreach(var c in _allCiphers)
|
||||
foreach (var c in _allCiphers)
|
||||
{
|
||||
if(MainPage)
|
||||
if (MainPage)
|
||||
{
|
||||
if(c.Favorite)
|
||||
if (c.Favorite)
|
||||
{
|
||||
if(FavoriteCiphers == null)
|
||||
if (FavoriteCiphers == null)
|
||||
{
|
||||
FavoriteCiphers = new List<CipherView>();
|
||||
}
|
||||
FavoriteCiphers.Add(c);
|
||||
}
|
||||
if(c.FolderId == null)
|
||||
if (c.FolderId == null)
|
||||
{
|
||||
if(NoFolderCiphers == null)
|
||||
if (NoFolderCiphers == null)
|
||||
{
|
||||
NoFolderCiphers = new List<CipherView>();
|
||||
}
|
||||
NoFolderCiphers.Add(c);
|
||||
}
|
||||
|
||||
if(_typeCounts.ContainsKey(c.Type))
|
||||
if (_typeCounts.ContainsKey(c.Type))
|
||||
{
|
||||
_typeCounts[c.Type] = _typeCounts[c.Type] + 1;
|
||||
}
|
||||
@@ -430,7 +430,7 @@ namespace Bit.App.Pages
|
||||
}
|
||||
|
||||
var fId = c.FolderId ?? "none";
|
||||
if(_folderCounts.ContainsKey(fId))
|
||||
if (_folderCounts.ContainsKey(fId))
|
||||
{
|
||||
_folderCounts[fId] = _folderCounts[fId] + 1;
|
||||
}
|
||||
@@ -439,11 +439,11 @@ namespace Bit.App.Pages
|
||||
_folderCounts.Add(fId, 1);
|
||||
}
|
||||
|
||||
if(c.CollectionIds != null)
|
||||
if (c.CollectionIds != null)
|
||||
{
|
||||
foreach(var colId in c.CollectionIds)
|
||||
foreach (var colId in c.CollectionIds)
|
||||
{
|
||||
if(_collectionCounts.ContainsKey(colId))
|
||||
if (_collectionCounts.ContainsKey(colId))
|
||||
{
|
||||
_collectionCounts[colId] = _collectionCounts[colId] + 1;
|
||||
}
|
||||
@@ -458,7 +458,7 @@ namespace Bit.App.Pages
|
||||
|
||||
private async void CipherOptionsAsync(CipherView cipher)
|
||||
{
|
||||
if((Page as BaseContentPage).DoOnce())
|
||||
if ((Page as BaseContentPage).DoOnce())
|
||||
{
|
||||
await AppHelpers.CipherListOptions(Page, cipher);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user