Apply R# clean-up for reliability (#877)
* Apply R# clean-up for reliability - Migrate to NUnit4 Assert.That - Update dependencise versions - Fix LangVersion to 9.0 (until net core migration) - Reformat code - Apply 'var' style (easier for refactoring) - Remove redundant parentheses - Add braces on every condition blocks (1 line) - Uses new null checking patterns - Uses AutoProperties when possible - Uses string scalar type instead of class - Clean usings - Add .orig files in git ignore - Rename some properties to respect defined conventions and US format definition - ID -> Id - BPM -> Bpm - Finish -> End * Update R# settings according to the clean-up made
This commit is contained in:
1 parent
b9b0f7c8df
commit
6ffa63b923
236 files changed
+14194
-7278
No files matched your search
@@ -25,7 +25,7 @@ namespace VocaluxeLib.Draw
|
||||
/// </summary>
|
||||
public class CTextureRef : IDisposable
|
||||
{
|
||||
public int ID { get; private set; }
|
||||
public int Id { get; private set; }
|
||||
/// <summary>
|
||||
/// Size of original image (e.g. of bmp)
|
||||
/// </summary>
|
||||
@@ -46,11 +46,11 @@ namespace VocaluxeLib.Draw
|
||||
/// <summary>
|
||||
/// Creates a new texture reference
|
||||
/// </summary>
|
||||
/// <param name="id">ID of the texture</param>
|
||||
/// <param name="id">Id of the texture</param>
|
||||
/// <param name="origSize">Original size (Bitmap size)</param>
|
||||
public CTextureRef(int id, Size origSize)
|
||||
{
|
||||
ID = id;
|
||||
Id = id;
|
||||
OrigSize = origSize;
|
||||
|
||||
Rect = new SRectF(0f, 0f, origSize.Width, origSize.Height, 0f);
|
||||
@@ -63,10 +63,10 @@ namespace VocaluxeLib.Draw
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (ID >= 0)
|
||||
if (Id >= 0)
|
||||
{
|
||||
//Free textures that are no longer referenced
|
||||
CTextureRef tmp = this;
|
||||
var tmp = this;
|
||||
CBase.Drawing.RemoveTexture(ref tmp);
|
||||
_SetRemoved();
|
||||
}
|
||||
@@ -78,14 +78,17 @@ namespace VocaluxeLib.Draw
|
||||
/// </summary>
|
||||
public void SetRemoved()
|
||||
{
|
||||
if (ID < 0)
|
||||
if (Id < 0)
|
||||
{
|
||||
throw new ObjectDisposedException(GetType().Name);
|
||||
}
|
||||
|
||||
_SetRemoved();
|
||||
}
|
||||
|
||||
private void _SetRemoved()
|
||||
{
|
||||
ID = -1;
|
||||
Id = -1;
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user