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:
Quentin Bray authored and GitHub committed 2026-06-22 19:52:06 +02:00
1 parent b9b0f7c8df
commit 6ffa63b923
236 files changed
+14194 -7278

No files matched your search

+23 -19
View File
@@ -6,7 +6,8 @@ namespace VocaluxeLib.Menu
[XmlType("RatingPopup")]
public struct SThemeRatingPopup
{
[XmlAttribute(AttributeName = "Name")] public string Name;
[XmlAttribute(AttributeName = "Name")]
public string Name;
public string SkinRatingPopup;
public SRectF Rect;
public SThemeText Text;
@@ -14,12 +15,12 @@ namespace VocaluxeLib.Menu
public sealed class CRatingPopup : CMenuElementBase, IMenuElement, IThemeable
{
private readonly int _PartyModeID;
private readonly int _PartyModeId;
private SThemeRatingPopup _Theme;
private CTextureRef _TextureRatingPopup;
public CTextureRef TextureRatingPopup
{
get { return _TextureRatingPopup ?? CBase.Themes.GetSkinTexture(_Theme.SkinRatingPopup, _PartyModeID); }
get { return _TextureRatingPopup ?? CBase.Themes.GetSkinTexture(_Theme.SkinRatingPopup, _PartyModeId); }
set { _TextureRatingPopup = value; }
}
@@ -30,17 +31,17 @@ namespace VocaluxeLib.Menu
public float Alpha = 1;
public SColorF Color;
public CRatingPopup(int partyModeID)
public CRatingPopup(int partyModeId)
{
_PartyModeID = partyModeID;
Text = new CText(partyModeID);
_PartyModeId = partyModeId;
Text = new CText(partyModeId);
Text.AllMonitors = false;
Visible = false;
}
public CRatingPopup(CRatingPopup rp)
{
_PartyModeID = rp._PartyModeID;
_PartyModeId = rp._PartyModeId;
_TextureRatingPopup = rp._TextureRatingPopup;
Text = new CText(rp.Text);
Text.AllMonitors = false;
@@ -48,26 +49,25 @@ namespace VocaluxeLib.Menu
MaxRect = rp.MaxRect;
}
public CRatingPopup(SThemeRatingPopup theme, int partyModeID)
public CRatingPopup(SThemeRatingPopup theme, int partyModeId)
{
_Theme = theme;
_PartyModeID = partyModeID;
Text = new CText(theme.Text, partyModeID);
_PartyModeId = partyModeId;
Text = new CText(theme.Text, partyModeId);
Text.AllMonitors = false;
Visible = false;
ThemeLoaded = true;
}
public void Draw()
{
SColorF color = Color;
var color = Color;
color.A = Alpha;
Text.Color.A = Alpha;
if (_TextureRatingPopup != null)
{
CBase.Drawing.DrawTexture(_TextureRatingPopup , Rect, color, false);
CBase.Drawing.DrawTexture(_TextureRatingPopup, Rect, color, false);
}
Text.DrawRelative(Rect.X, Rect.Y);
@@ -87,17 +87,17 @@ namespace VocaluxeLib.Menu
public void LoadSkin()
{
if (!ThemeLoaded)
{
return;
}
TextureRatingPopup = CBase.Themes.GetSkinTexture(_Theme.SkinRatingPopup, _PartyModeID);
Text = new CText(_Theme.Text, _PartyModeID);
TextureRatingPopup = CBase.Themes.GetSkinTexture(_Theme.SkinRatingPopup, _PartyModeId);
Text = new CText(_Theme.Text, _PartyModeId);
Text.LoadSkin();
MaxRect = _Theme.Rect;
}
public void UnloadSkin()
{
}
public void UnloadSkin() { }
public void ReloadSkin()
{
@@ -118,14 +118,18 @@ namespace VocaluxeLib.Menu
{
W += stepW;
if (W <= 0)
{
W = 1;
}
H += stepH;
if (H <= 0)
{
H = 1;
}
_Theme.Rect.W = Rect.W;
_Theme.Rect.H = Rect.H;
}
}
}
}