More refactoring (mainly LINQ)

This commit is contained in:
Flamefire committed 2013-04-24 00:41:08 +02:00
1 parent 181490fa87
commit b1e28ae7bc
43 files changed
+488 -662

No files matched your search

+6 -4
View File
@@ -47,7 +47,7 @@ namespace VocaluxeLib.Menu.SongMenu
public class CCategory
{
public string Name = String.Empty;
public readonly string Name;
private STexture _CoverTextureSmall = new STexture(-1);
private STexture _CoverTextureBig = new STexture(-1);
private bool _CoverBigLoaded;
@@ -100,7 +100,9 @@ namespace VocaluxeLib.Menu.SongMenu
public float FadeInTime;
public float FadeOutTime;
// ReSharper disable UnusedParameter.Local
public SMedley(int dummy)
// ReSharper restore UnusedParameter.Local
{
Source = EMedleySource.None;
StartBeat = 0;
@@ -210,11 +212,11 @@ namespace VocaluxeLib.Menu.SongMenu
get { return Notes.Lines.Length > 1; }
}
public List<string> Edition = new List<string>();
public List<string> Genre = new List<string>();
public readonly List<string> Edition = new List<string>();
public readonly List<string> Genre = new List<string>();
public string Year = "";
public List<string> Language = new List<string>();
public readonly List<string> Language = new List<string>();
// Notes
public readonly CNotes Notes = new CNotes();
@@ -95,7 +95,7 @@ namespace VocaluxeLib.Menu.SongMenu
abstract class CSongMenuFramework : ISongMenu
{
protected int _PartyModeID;
protected readonly int _PartyModeID;
protected SThemeSongMenu _Theme;
private bool _ThemeLoaded;
@@ -164,7 +164,7 @@ namespace VocaluxeLib.Menu.SongMenu
}
}
protected virtual void _SetSelectedNow()
protected void _SetSelectedNow()
{
_Timer.Stop();
_Timer.Reset();
@@ -425,7 +425,7 @@ namespace VocaluxeLib.Menu.SongMenu
_Initialized = true;
}
public virtual void UpdateRect(SRectF rect)
public void UpdateRect(SRectF rect)
{
_Rect = rect;
Init();
@@ -20,6 +20,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using VocaluxeLib.PartyModes;
@@ -180,15 +181,7 @@ namespace VocaluxeLib.Menu.SongMenu
keyEvent.Key == Keys.PageDown || keyEvent.Key == Keys.PageUp))
return;
bool sel = false;
foreach (CStatic tile in _Tiles)
{
if (tile.Selected)
{
sel = true;
break;
}
}
bool sel = _Tiles.Any(tile => tile.Selected);
if ((_Locked == -1 || !sel) &&
(keyEvent.Key != Keys.Escape && keyEvent.Key != Keys.Back && keyEvent.Key != Keys.PageUp && keyEvent.Key != Keys.PageDown))
@@ -500,15 +493,7 @@ namespace VocaluxeLib.Menu.SongMenu
protected void _SetSelectedTile(int itemNr)
{
bool sel = false;
foreach (CStatic tile in _Tiles)
{
if (tile.Selected)
{
sel = true;
break;
}
}
bool sel = _Tiles.Any(tile => tile.Selected);
if (_Locked == -1 || !sel)
{