Hide obsolete warnings

This commit is contained in:
Jaex 2022-02-15 11:16:20 +03:00
parent 1ea1dacb0f
commit cf0336c0f4
2 changed files with 5 additions and 8 deletions

View file

@ -568,10 +568,6 @@ public B2UploadResult(int rc, B2Error error, B2Upload upload)
#region JSON responses
// we disable these IDE warnings here because this is effectively generated code
#pragma warning disable IDE1006 // Naming Styles
// ReSharper disable ClassNeverInstantiated.Local, MemberCanBePrivate.Local, UnusedAutoPropertyAccessor.Local
/// <summary>
/// The b2_authorize_account API's optional 'allowed' field.
/// </summary>
@ -674,9 +670,6 @@ public B2Upload(string fileId, string fileName, string accountId, string bucketI
}
}
// ReSharper restore ClassNeverInstantiated.Local, MemberCanBePrivate.Local, UnusedAutoPropertyAccessor.Local
#pragma warning restore IDE1006 // Naming Styles
#endregion JSON responses
}
}
}

View file

@ -255,10 +255,12 @@ public bool UploadData(Stream localStream, string remotePath)
private bool UploadDataInternal(Stream localStream, string remotePath)
{
bool result;
#pragma warning disable 0618
using (Stream remoteStream = client.OpenWrite(remotePath))
{
result = TransferData(localStream, remoteStream);
}
#pragma warning restore 0618
FtpReply ftpReply = client.GetReply();
return result && ftpReply.Success;
}
@ -325,10 +327,12 @@ public void DownloadFile(string remotePath, Stream localStream)
{
if (Connect())
{
#pragma warning disable 0618
using (Stream remoteStream = client.OpenRead(remotePath))
{
TransferData(remoteStream, localStream);
}
#pragma warning restore 0618
client.GetReply();
}
}