mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 00:52:49 -05:00
Changed all C# control flow block statements to include space between keyword and open paren
This commit is contained in:
@ -28,12 +28,12 @@ namespace Bit.Core.Models.Table
|
||||
|
||||
public Dictionary<string, CipherAttachment.MetaData> GetAttachments()
|
||||
{
|
||||
if(string.IsNullOrWhiteSpace(Attachments))
|
||||
if (string.IsNullOrWhiteSpace(Attachments))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if(_attachmentData != null)
|
||||
if (_attachmentData != null)
|
||||
{
|
||||
return _attachmentData;
|
||||
}
|
||||
@ -51,7 +51,7 @@ namespace Bit.Core.Models.Table
|
||||
|
||||
public void SetAttachments(Dictionary<string, CipherAttachment.MetaData> data)
|
||||
{
|
||||
if(data == null || data.Count == 0)
|
||||
if (data == null || data.Count == 0)
|
||||
{
|
||||
_attachmentData = null;
|
||||
Attachments = null;
|
||||
@ -65,7 +65,7 @@ namespace Bit.Core.Models.Table
|
||||
public void AddAttachment(string id, CipherAttachment.MetaData data)
|
||||
{
|
||||
var attachments = GetAttachments();
|
||||
if(attachments == null)
|
||||
if (attachments == null)
|
||||
{
|
||||
attachments = new Dictionary<string, CipherAttachment.MetaData>();
|
||||
}
|
||||
@ -77,7 +77,7 @@ namespace Bit.Core.Models.Table
|
||||
public void DeleteAttachment(string id)
|
||||
{
|
||||
var attachments = GetAttachments();
|
||||
if(!attachments?.ContainsKey(id) ?? true)
|
||||
if (!attachments?.ContainsKey(id) ?? true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ namespace Bit.Core.Models.Table
|
||||
|
||||
public void SetNewId()
|
||||
{
|
||||
if(Id == default(Guid))
|
||||
if (Id == default(Guid))
|
||||
{
|
||||
Id = CoreHelpers.GenerateComb();
|
||||
}
|
||||
@ -86,7 +86,7 @@ namespace Bit.Core.Models.Table
|
||||
|
||||
public long StorageBytesRemaining()
|
||||
{
|
||||
if(!MaxStorageGb.HasValue)
|
||||
if (!MaxStorageGb.HasValue)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -97,7 +97,7 @@ namespace Bit.Core.Models.Table
|
||||
public long StorageBytesRemaining(short maxStorageGb)
|
||||
{
|
||||
var maxStorageBytes = maxStorageGb * 1073741824L;
|
||||
if(!Storage.HasValue)
|
||||
if (!Storage.HasValue)
|
||||
{
|
||||
return maxStorageBytes;
|
||||
}
|
||||
@ -107,14 +107,14 @@ namespace Bit.Core.Models.Table
|
||||
|
||||
public Dictionary<TwoFactorProviderType, TwoFactorProvider> GetTwoFactorProviders()
|
||||
{
|
||||
if(string.IsNullOrWhiteSpace(TwoFactorProviders))
|
||||
if (string.IsNullOrWhiteSpace(TwoFactorProviders))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if(_twoFactorProviders == null)
|
||||
if (_twoFactorProviders == null)
|
||||
{
|
||||
_twoFactorProviders =
|
||||
JsonConvert.DeserializeObject<Dictionary<TwoFactorProviderType, TwoFactorProvider>>(
|
||||
@ -123,7 +123,7 @@ namespace Bit.Core.Models.Table
|
||||
|
||||
return _twoFactorProviders;
|
||||
}
|
||||
catch(JsonSerializationException)
|
||||
catch (JsonSerializationException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@ -131,7 +131,7 @@ namespace Bit.Core.Models.Table
|
||||
|
||||
public void SetTwoFactorProviders(Dictionary<TwoFactorProviderType, TwoFactorProvider> providers)
|
||||
{
|
||||
if(!providers.Any())
|
||||
if (!providers.Any())
|
||||
{
|
||||
TwoFactorProviders = null;
|
||||
_twoFactorProviders = null;
|
||||
@ -148,7 +148,7 @@ namespace Bit.Core.Models.Table
|
||||
public bool TwoFactorProviderIsEnabled(TwoFactorProviderType provider)
|
||||
{
|
||||
var providers = GetTwoFactorProviders();
|
||||
if(providers == null || !providers.ContainsKey(provider))
|
||||
if (providers == null || !providers.ContainsKey(provider))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -159,7 +159,7 @@ namespace Bit.Core.Models.Table
|
||||
public bool TwoFactorIsEnabled()
|
||||
{
|
||||
var providers = GetTwoFactorProviders();
|
||||
if(providers == null)
|
||||
if (providers == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -170,7 +170,7 @@ namespace Bit.Core.Models.Table
|
||||
public TwoFactorProvider GetTwoFactorProvider(TwoFactorProviderType provider)
|
||||
{
|
||||
var providers = GetTwoFactorProviders();
|
||||
if(providers == null || !providers.ContainsKey(provider))
|
||||
if (providers == null || !providers.ContainsKey(provider))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -80,14 +80,14 @@ namespace Bit.Core.Models.Table
|
||||
|
||||
public Dictionary<TwoFactorProviderType, TwoFactorProvider> GetTwoFactorProviders()
|
||||
{
|
||||
if(string.IsNullOrWhiteSpace(TwoFactorProviders))
|
||||
if (string.IsNullOrWhiteSpace(TwoFactorProviders))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if(_twoFactorProviders == null)
|
||||
if (_twoFactorProviders == null)
|
||||
{
|
||||
_twoFactorProviders =
|
||||
JsonConvert.DeserializeObject<Dictionary<TwoFactorProviderType, TwoFactorProvider>>(
|
||||
@ -96,7 +96,7 @@ namespace Bit.Core.Models.Table
|
||||
|
||||
return _twoFactorProviders;
|
||||
}
|
||||
catch(JsonSerializationException)
|
||||
catch (JsonSerializationException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@ -124,7 +124,7 @@ namespace Bit.Core.Models.Table
|
||||
public TwoFactorProvider GetTwoFactorProvider(TwoFactorProviderType provider)
|
||||
{
|
||||
var providers = GetTwoFactorProviders();
|
||||
if(providers == null || !providers.ContainsKey(provider))
|
||||
if (providers == null || !providers.ContainsKey(provider))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@ -134,7 +134,7 @@ namespace Bit.Core.Models.Table
|
||||
|
||||
public long StorageBytesRemaining()
|
||||
{
|
||||
if(!MaxStorageGb.HasValue)
|
||||
if (!MaxStorageGb.HasValue)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -145,7 +145,7 @@ namespace Bit.Core.Models.Table
|
||||
public long StorageBytesRemaining(short maxStorageGb)
|
||||
{
|
||||
var maxStorageBytes = maxStorageGb * 1073741824L;
|
||||
if(!Storage.HasValue)
|
||||
if (!Storage.HasValue)
|
||||
{
|
||||
return maxStorageBytes;
|
||||
}
|
||||
|
Reference in New Issue
Block a user