Changed string comparisons to easier != "" syntax

This commit is contained in:
Flamefire committed 2013-04-23 14:52:51 +02:00
1 parent 1540be9120
commit cf39a4b107
74 files changed
+318 -338

No files matched your search

+17 -17
View File
@@ -369,7 +369,7 @@ namespace VocaluxeLib.Menu.SongMenu
while (!sr.EndOfStream)
{
string line = sr.ReadLine();
if (line.Length == 0)
if (line == "")
continue;
if (!line[0].ToString().Equals("#"))
break;
@@ -381,7 +381,7 @@ namespace VocaluxeLib.Menu.SongMenu
string identifier = line.Substring(1, pos - 1).Trim().ToUpper();
string value = line.Substring(pos + 1, line.Length - pos - 1).Trim();
if (value.Length > 0)
if (value != "")
{
switch (identifier)
{
@@ -395,7 +395,7 @@ namespace VocaluxeLib.Menu.SongMenu
while (!sr.EndOfStream)
{
line = sr.ReadLine();
if (line.Length == 0)
if (line == "")
continue;
if (!line[0].ToString().Equals("#"))
break;
@@ -411,33 +411,33 @@ namespace VocaluxeLib.Menu.SongMenu
}
break;
case "TITLE":
if (value.Length > 0)
if (value != "")
{
Title = value;
headerFlags |= EHeaderFlags.Title;
}
break;
case "ARTIST":
if (value.Length > 0)
if (value != "")
{
Artist = value;
headerFlags |= EHeaderFlags.Artist;
}
break;
case "TITLE-ON-SORTING":
if (value.Length > 0)
if (value != "")
TitleSorting = value;
break;
case "ARTIST-ON-SORTING":
if (value.Length > 0)
if (value != "")
ArtistSorting = value;
break;
case "P1":
if (value.Length > 0)
if (value != "")
DuetPart1 = value;
break;
case "P2":
if (value.Length > 0)
if (value != "")
DuetPart2 = value;
break;
case "MP3":
@@ -608,10 +608,10 @@ namespace VocaluxeLib.Menu.SongMenu
_CheckFiles();
//Before saving this tags to .txt: Check, if ArtistSorting and Artist are equal, then don't save this tag.
if (ArtistSorting.Length == 0)
if (ArtistSorting == "")
ArtistSorting = Artist;
if (TitleSorting.Length == 0)
if (TitleSorting == "")
TitleSorting = Title;
return true;
@@ -821,7 +821,7 @@ namespace VocaluxeLib.Menu.SongMenu
{
if (_CoverSmallLoaded)
return;
if (CoverFileName.Length > 0)
if (CoverFileName != "")
{
if (!CBase.DataBase.GetCover(Path.Combine(Folder, CoverFileName), ref _CoverTextureSmall, CBase.Config.GetCoverSize()))
_CoverTextureSmall = CBase.Cover.GetNoCover();
@@ -834,7 +834,7 @@ namespace VocaluxeLib.Menu.SongMenu
private void _CheckFiles()
{
if (CoverFileName.Length == 0)
if (CoverFileName == "")
{
List<string> files = CHelper.ListFiles(Folder, "*.jpg", false);
files.AddRange(CHelper.ListFiles(Folder, "*.png", false));
@@ -846,7 +846,7 @@ namespace VocaluxeLib.Menu.SongMenu
}
}
if (BackgroundFileName.Length == 0)
if (BackgroundFileName == "")
{
List<string> files = CHelper.ListFiles(Folder, "*.jpg", false);
files.AddRange(CHelper.ListFiles(Folder, "*.png", false));
@@ -861,12 +861,12 @@ namespace VocaluxeLib.Menu.SongMenu
private void _CheckDuet()
{
if (DuetPart1.Length == 0)
if (DuetPart1 == "")
{
DuetPart1 = "Part 1";
CBase.Log.LogError("Warning: Can't find #P1-tag for duets in \"" + Artist + " - " + Title + "\".");
}
if (DuetPart2.Length == 0)
if (DuetPart2 == "")
{
DuetPart2 = "Part 2";
CBase.Log.LogError("Warning: Can't find #P2-tag for duets in \"" + Artist + " - " + Title + "\".");
@@ -915,7 +915,7 @@ namespace VocaluxeLib.Menu.SongMenu
for (int k = 1; k <= max; k++)
{
if (sentences[i + k] == sentences[j + k] && sentences[i + k]!="")
if (sentences[i + k] == sentences[j + k] && sentences[i + k] != "")
tempSeries.End = i + k;
else
break;
@@ -44,7 +44,7 @@ namespace VocaluxeLib.Menu.SongMenu
public CSongMenuDreidel(int partyModeID)
: base(partyModeID) {}
// ReSharper disable RedundantOverridenMember
// ReSharper disable RedundantOverridenMember
public override void Init()
{
base.Init();
@@ -59,6 +59,7 @@ namespace VocaluxeLib.Menu.SongMenu
_SongLength = _Theme.songMenuDreidel.TextSongLength;
**/
}
// ReSharper restore RedundantOverridenMember
// ReSharper restore RedundantOverridenMember
}
}
@@ -349,7 +349,7 @@ namespace VocaluxeLib.Menu.SongMenu
writer.WriteComment("<Color>: Tile color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName.Length > 0)
if (_Theme.ColorName != "")
writer.WriteElementString("Color", _Theme.ColorName);
else
{
@@ -481,13 +481,9 @@ namespace VocaluxeLib.Menu.SongMenu
_SelectedInternal = _SelectedPending;
}
public virtual void HandleInput(ref SKeyEvent keyEvent, SScreenSongOptions songOptions)
{
}
public virtual void HandleInput(ref SKeyEvent keyEvent, SScreenSongOptions songOptions) {}
public virtual void HandleMouse(ref SMouseEvent mouseEvent, SScreenSongOptions songOptions)
{
}
public virtual void HandleMouse(ref SMouseEvent mouseEvent, SScreenSongOptions songOptions) {}
public virtual void Draw()
{
@@ -531,17 +527,11 @@ namespace VocaluxeLib.Menu.SongMenu
return -1;
}
public virtual void SetSelectedSong(int visibleSongNr)
{
}
public virtual void SetSelectedSong(int visibleSongNr) {}
public virtual void SetSelectedCategory(int categoryNr)
{
}
public virtual void SetSelectedCategory(int categoryNr) {}
public virtual void SetSmallView(bool smallView)
{
}
public virtual void SetSmallView(bool smallView) {}
public virtual bool IsSmallView()
{
@@ -554,7 +544,7 @@ namespace VocaluxeLib.Menu.SongMenu
{
Init();
if (_Theme.ColorName.Length > 0)
if (_Theme.ColorName != "")
_Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
}
@@ -635,7 +625,7 @@ namespace VocaluxeLib.Menu.SongMenu
_Streams.Add(stream);
_Actsongstream = stream;
if (CBase.Songs.GetVisibleSong(_Actsong).VideoFileName.Length > 0 && CBase.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON)
if (CBase.Songs.GetVisibleSong(_Actsong).VideoFileName != "" && CBase.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON)
{
_Video = CBase.Video.Load(Path.Combine(CBase.Songs.GetVisibleSong(_Actsong).Folder, CBase.Songs.GetVisibleSong(_Actsong).VideoFileName));
if (_Video == -1)
@@ -154,7 +154,7 @@ namespace VocaluxeLib.Menu.SongMenu
_MedleyTagIcon.Visible = false;
}
if (CBase.Songs.GetNumVisibleSongs() == 0 && CBase.Songs.GetSearchFilter().Length > 0)
if (CBase.Songs.GetNumVisibleSongs() == 0 && CBase.Songs.GetSearchFilter() != "")
{
_CoverBig.Texture = _CoverBigTexture;
_Artist.Text = String.Empty;
@@ -418,7 +418,7 @@ namespace VocaluxeLib.Menu.SongMenu
_Artist.Text = song.Artist;
_Title.Text = song.Title;
_DuetIcon.Visible = song.IsDuet;
_VideoIcon.Visible = song.VideoFileName.Length > 0;
_VideoIcon.Visible = song.VideoFileName != "";
_MedleyCalcIcon.Visible = song.Medley.Source == EMedleySource.Calculated;
_MedleyTagIcon.Visible = song.Medley.Source == EMedleySource.Tag;