Made the code checker a bit happier
This commit is contained in:
1 parent
d5cb43a09f
commit
3ebd34fcc3
48 files changed
+525
-479
No files matched your search
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RuleSet Name="Kopie von "Microsoft Extended Correctness Rules"" Description="These rules expand on the basic correctness rules to maximize the logic and framework usage errors that are reported. Extra emphasis is placed on specific scenarios such as COM interop and mobile applications. Consider including this rule set if one of these scenarios applies to your project or to find additional problems in your project." ToolsVersion="10.0">
|
||||
<Include Path="basiccorrectnessrules.ruleset" Action="Default" />
|
||||
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
|
||||
<Rule Id="CA1032" Action="Warning" />
|
||||
<Rule Id="CA1054" Action="Warning" />
|
||||
<Rule Id="CA1055" Action="Warning" />
|
||||
<Rule Id="CA1056" Action="Warning" />
|
||||
<Rule Id="CA1057" Action="Warning" />
|
||||
<Rule Id="CA1060" Action="None" />
|
||||
<Rule Id="CA1301" Action="None" />
|
||||
<Rule Id="CA1303" Action="None" />
|
||||
<Rule Id="CA1308" Action="None" />
|
||||
<Rule Id="CA1401" Action="None" />
|
||||
<Rule Id="CA1402" Action="Warning" />
|
||||
<Rule Id="CA1406" Action="Warning" />
|
||||
<Rule Id="CA1407" Action="Warning" />
|
||||
<Rule Id="CA1408" Action="Warning" />
|
||||
<Rule Id="CA1409" Action="Warning" />
|
||||
<Rule Id="CA1411" Action="Warning" />
|
||||
<Rule Id="CA1412" Action="Warning" />
|
||||
<Rule Id="CA1413" Action="Warning" />
|
||||
<Rule Id="CA1414" Action="Warning" />
|
||||
<Rule Id="CA1600" Action="Warning" />
|
||||
<Rule Id="CA1601" Action="Warning" />
|
||||
<Rule Id="CA1821" Action="Warning" />
|
||||
<Rule Id="CA1824" Action="Warning" />
|
||||
<Rule Id="CA2001" Action="Warning" />
|
||||
<Rule Id="CA2003" Action="Warning" />
|
||||
<Rule Id="CA2101" Action="None" />
|
||||
<Rule Id="CA2135" Action="Warning" />
|
||||
<Rule Id="CA2136" Action="Warning" />
|
||||
<Rule Id="CA2139" Action="Warning" />
|
||||
<Rule Id="CA2142" Action="Warning" />
|
||||
<Rule Id="CA2143" Action="Warning" />
|
||||
<Rule Id="CA2144" Action="Warning" />
|
||||
<Rule Id="CA2145" Action="Warning" />
|
||||
<Rule Id="CA2204" Action="Warning" />
|
||||
<Rule Id="CA2211" Action="Warning" />
|
||||
<Rule Id="CA2217" Action="Warning" />
|
||||
<Rule Id="CA2218" Action="Warning" />
|
||||
<Rule Id="CA2219" Action="Warning" />
|
||||
<Rule Id="CA2225" Action="Warning" />
|
||||
<Rule Id="CA2228" Action="Warning" />
|
||||
<Rule Id="CA2230" Action="Warning" />
|
||||
<Rule Id="CA2233" Action="Warning" />
|
||||
<Rule Id="CA2234" Action="Warning" />
|
||||
<Rule Id="CA2243" Action="Warning" />
|
||||
</Rules>
|
||||
</RuleSet>
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Express 2012 for Windows Desktop
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vocaluxe", "Vocaluxe\Vocaluxe.csproj", "{2A1E0F2D-5392-4BB7-B0A1-A9DFA13E79FF}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{6F3E1874-F28A-40E9-AFBD-31934D593679} = {6F3E1874-F28A-40E9-AFBD-31934D593679}
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_CurrentPlaylistElement.Artist != "" && _CurrentPlaylistElement.Title != "")
|
||||
if (_CurrentPlaylistElement.Artist.Length > 0 && _CurrentPlaylistElement.Title.Length > 0)
|
||||
return _CurrentPlaylistElement.Artist + " - " + _CurrentPlaylistElement.Title;
|
||||
else
|
||||
return Path.GetFileNameWithoutExtension(_CurrentPlaylistElement.MusicFilePath);
|
||||
|
||||
@@ -287,7 +287,8 @@ namespace Vocaluxe.Base
|
||||
XmlWriter writer = null;
|
||||
try
|
||||
{
|
||||
writer = XmlWriter.Create(CSettings.sFileConfig, _settings);
|
||||
using (writer = XmlWriter.Create(CSettings.sFileConfig, _settings))
|
||||
{
|
||||
writer.WriteStartDocument();
|
||||
writer.WriteStartElement("root");
|
||||
|
||||
@@ -526,7 +527,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
for (int p = 1; p <= CSettings.MaxNumPlayer; p++)
|
||||
{
|
||||
if (MicConfig[p - 1].DeviceName != String.Empty && MicConfig[p - 1].InputName != String.Empty && MicConfig[p - 1].Channel > 0)
|
||||
if (MicConfig[p - 1].DeviceName.Length > 0 && MicConfig[p - 1].InputName.Length > 0 && MicConfig[p - 1].Channel > 0)
|
||||
{
|
||||
writer.WriteStartElement("MicConfig" + p.ToString());
|
||||
|
||||
@@ -551,12 +552,13 @@ namespace Vocaluxe.Base
|
||||
writer.Flush();
|
||||
writer.Close();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
writer = null;
|
||||
if (writer != null)
|
||||
writer.Close();
|
||||
return false;
|
||||
}
|
||||
writer = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -731,7 +733,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
//Only found a parameter
|
||||
case 1:
|
||||
if (!Regex.IsMatch(parts[0], @"\s") && parts[0] != string.Empty)
|
||||
if (!Regex.IsMatch(parts[0], @"\s") && parts[0].Length > 0)
|
||||
{
|
||||
//Add parameter
|
||||
_Params.Add(parts[0]);
|
||||
@@ -744,7 +746,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
//Found parameter and value
|
||||
case 2:
|
||||
if (!Regex.IsMatch(parts[0], @"\s") && parts[0] != string.Empty)
|
||||
if (!Regex.IsMatch(parts[0], @"\s") && parts[0].Length > 0)
|
||||
{
|
||||
//Add parameter
|
||||
_Params.Add(parts[0]);
|
||||
@@ -856,7 +858,7 @@ namespace Vocaluxe.Base
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (Path.GetFileName(value) == string.Empty)
|
||||
if (Path.GetFileName(value).Length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -876,7 +878,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
for (int j = 0; j < CSettings.MaxNumPlayer; j++)
|
||||
{
|
||||
if (Players[j] != string.Empty)
|
||||
if (Players[j].Length > 0)
|
||||
{
|
||||
if (Path.GetFileName(CProfiles.Profiles[i].ProfileFile) == Players[j] && CProfiles.Profiles[i].Active == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace Vocaluxe.Base
|
||||
xmlReader.GetValue("//root/Info/Name", ref coverTheme.Name, String.Empty);
|
||||
xmlReader.GetValue("//root/Info/Folder", ref coverTheme.Folder, String.Empty);
|
||||
|
||||
if (coverTheme.Folder != String.Empty && coverTheme.Name != String.Empty)
|
||||
if (coverTheme.Folder.Length > 0 && coverTheme.Name.Length > 0)
|
||||
{
|
||||
coverTheme.File = file;
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
coverTheme = CoverTheme(coverThemeName);
|
||||
|
||||
if (coverTheme.Name != String.Empty)
|
||||
if (coverTheme.Name.Length > 0)
|
||||
{
|
||||
|
||||
CXMLReader xmlReader = CXMLReader.OpenFile((Path.Combine(CSettings.sFolderCover, coverTheme.File)));
|
||||
|
||||
+164
-293
File diff suppressed because it is too large.
Load diff
@@ -73,7 +73,9 @@ namespace Vocaluxe.Base
|
||||
|
||||
public static bool Unload()
|
||||
{
|
||||
return _Draw.Unload();
|
||||
bool result = _Draw.Unload();
|
||||
_Draw = null;
|
||||
return result;
|
||||
}
|
||||
|
||||
public static int GetScreenWidth()
|
||||
@@ -166,7 +168,8 @@ namespace Vocaluxe.Base
|
||||
if (!System.IO.File.Exists(TexturePath))
|
||||
return new STexture(-1);
|
||||
|
||||
Bitmap origin = new Bitmap(TexturePath);
|
||||
using (Bitmap origin = new Bitmap(TexturePath))
|
||||
{
|
||||
int w = MaxSize;
|
||||
int h = MaxSize;
|
||||
|
||||
@@ -175,12 +178,13 @@ namespace Vocaluxe.Base
|
||||
else if (origin.Height > origin.Width && origin.Height > h)
|
||||
w = (int)Math.Round((float)h / origin.Height * origin.Width);
|
||||
|
||||
Bitmap bmp = new Bitmap(origin, w, h);
|
||||
using (Bitmap bmp = new Bitmap(origin, w, h))
|
||||
{
|
||||
STexture tex = _Draw.AddTexture(bmp);
|
||||
bmp.Dispose();
|
||||
origin.Dispose();
|
||||
return tex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static STexture AddTexture(int W, int H, IntPtr Data)
|
||||
{
|
||||
|
||||
+44
-26
@@ -36,18 +36,24 @@ namespace Vocaluxe.Base
|
||||
|
||||
float factor = GetFactor(chr, flags);
|
||||
CFonts.Height = SIZEh * factor;
|
||||
Bitmap bmp = new Bitmap(10, 10);
|
||||
System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bmp);
|
||||
Font fo;
|
||||
Size sizeB;
|
||||
SizeF size;
|
||||
System.Drawing.Graphics g;
|
||||
using (Bitmap bmp = new Bitmap(10, 10))
|
||||
{
|
||||
g = System.Drawing.Graphics.FromImage(bmp);
|
||||
|
||||
Font fo = CFonts.GetFont();
|
||||
Size sizeB = TextRenderer.MeasureText(g, chr.ToString(), fo, new Size(int.MaxValue, int.MaxValue), flags);
|
||||
fo = CFonts.GetFont();
|
||||
sizeB = TextRenderer.MeasureText(g, chr.ToString(), fo, new Size(int.MaxValue, int.MaxValue), flags);
|
||||
|
||||
SizeF size = g.MeasureString(chr.ToString(), fo);
|
||||
size = g.MeasureString(chr.ToString(), fo);
|
||||
|
||||
g.Dispose();
|
||||
bmp.Dispose();
|
||||
}
|
||||
|
||||
bmp = new Bitmap((int)(sizeB.Width * 2f), sizeB.Height);
|
||||
using (Bitmap bmp = new Bitmap((int)(sizeB.Width * 2f), sizeB.Height))
|
||||
{
|
||||
g = System.Drawing.Graphics.FromImage(bmp);
|
||||
g.Clear(System.Drawing.Color.Transparent);
|
||||
|
||||
@@ -61,7 +67,8 @@ namespace Vocaluxe.Base
|
||||
outline * Math.Abs(sizeB.Width - size.Width) + (sizeB.Width - size.Width) / 2f + SIZEh / 5f,
|
||||
(sizeB.Height - size.Height - (size.Height + SIZEh / 4f) * (1f - factor)) / 2f);
|
||||
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
using (GraphicsPath path = new GraphicsPath())
|
||||
{
|
||||
path.AddString(
|
||||
chr.ToString(),
|
||||
fo.FontFamily,
|
||||
@@ -70,17 +77,20 @@ namespace Vocaluxe.Base
|
||||
point,
|
||||
new StringFormat());
|
||||
|
||||
Pen pen = new Pen(
|
||||
using (Pen pen = new Pen(
|
||||
Color.FromArgb(
|
||||
(int)CFonts.OutlineColor.A * 255,
|
||||
(int)CFonts.OutlineColor.R * 255,
|
||||
(int)CFonts.OutlineColor.G * 255,
|
||||
(int)CFonts.OutlineColor.B * 255),
|
||||
SIZEh * outline);
|
||||
SIZEh * outline))
|
||||
{
|
||||
|
||||
pen.LineJoin = LineJoin.Round;
|
||||
g.DrawPath(pen, path);
|
||||
g.FillPath(Brushes.White, path);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
g.DrawString(
|
||||
@@ -95,7 +105,7 @@ namespace Vocaluxe.Base
|
||||
Chr = chr;
|
||||
width = (int)((1f + outline / 2f) * sizeB.Width * Texture.width / factor / bmp.Width);
|
||||
|
||||
bmp.Dispose();
|
||||
}
|
||||
g.Dispose();
|
||||
fo.Dispose();
|
||||
}
|
||||
@@ -114,23 +124,31 @@ namespace Vocaluxe.Base
|
||||
|
||||
CFonts.Style = EStyle.Normal;
|
||||
CFonts.Height = SIZEh;
|
||||
Bitmap bmp = new Bitmap(10, 10);
|
||||
System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bmp);
|
||||
float h_style, h_normal;
|
||||
using (Bitmap bmp = new Bitmap(10, 10))
|
||||
{
|
||||
using (System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bmp))
|
||||
{
|
||||
|
||||
Font fo = CFonts.GetFont();
|
||||
Size sizeB = TextRenderer.MeasureText(g, chr.ToString(), fo, new Size(int.MaxValue, int.MaxValue), flags);
|
||||
//SizeF size = g.MeasureString(chr.ToString(), fo);
|
||||
float h_normal = sizeB.Height;
|
||||
|
||||
h_normal = sizeB.Height;
|
||||
}
|
||||
CFonts.Style = style;
|
||||
bmp = new Bitmap(10, 10);
|
||||
g = System.Drawing.Graphics.FromImage(bmp);
|
||||
|
||||
fo = CFonts.GetFont();
|
||||
sizeB = TextRenderer.MeasureText(g, chr.ToString(), fo, new Size(int.MaxValue, int.MaxValue), flags);
|
||||
}
|
||||
using (Bitmap bmp = new Bitmap(10, 10))
|
||||
{
|
||||
using (System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bmp))
|
||||
{
|
||||
|
||||
Font fo = CFonts.GetFont();
|
||||
Size sizeB = TextRenderer.MeasureText(g, chr.ToString(), fo, new Size(int.MaxValue, int.MaxValue), flags);
|
||||
//size = g.MeasureString(chr.ToString(), fo);
|
||||
float h_style = sizeB.Height;
|
||||
g.Dispose();
|
||||
h_style = sizeB.Height;
|
||||
}
|
||||
}
|
||||
return h_normal / h_style;
|
||||
}
|
||||
}
|
||||
@@ -415,7 +433,7 @@ namespace Vocaluxe.Base
|
||||
if (h <= 0f)
|
||||
return;
|
||||
|
||||
if (Text == String.Empty)
|
||||
if (Text.Length == 0)
|
||||
return;
|
||||
|
||||
Height = h;
|
||||
@@ -452,7 +470,7 @@ namespace Vocaluxe.Base
|
||||
if (h <= 0f)
|
||||
return;
|
||||
|
||||
if (Text == String.Empty)
|
||||
if (Text.Length == 0)
|
||||
return;
|
||||
|
||||
Height = h;
|
||||
@@ -489,7 +507,7 @@ namespace Vocaluxe.Base
|
||||
if (h <= 0f)
|
||||
return;
|
||||
|
||||
if (Text == String.Empty)
|
||||
if (Text.Length == 0)
|
||||
return;
|
||||
|
||||
Height = h;
|
||||
@@ -955,7 +973,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
private static int GetFontIndex(string ThemeName, string FontName)
|
||||
{
|
||||
if (ThemeName == String.Empty || FontName == String.Empty)
|
||||
if (ThemeName.Length == 0 || FontName.Length == 0)
|
||||
return -1;
|
||||
|
||||
for (int i = 0; i < _Fonts.Count; i++)
|
||||
@@ -969,7 +987,7 @@ namespace Vocaluxe.Base
|
||||
|
||||
private static int GetFontIndexParty(int PartyModeID, string FontName)
|
||||
{
|
||||
if (PartyModeID == -1 || FontName == String.Empty)
|
||||
if (PartyModeID == -1 || FontName.Length == 0)
|
||||
return -1;
|
||||
|
||||
for (int i = 0; i < _Fonts.Count; i++)
|
||||
|
||||
@@ -871,7 +871,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
_Cursor.UnloadTextures();
|
||||
|
||||
if (CTheme.Cursor.color != string.Empty)
|
||||
if (CTheme.Cursor.color.Length > 0)
|
||||
{
|
||||
SColorF color;
|
||||
color = CTheme.GetColor(CTheme.Cursor.color, -1);
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace Vocaluxe.Base
|
||||
public static void Close()
|
||||
{
|
||||
_Input.Close();
|
||||
_Input = null;
|
||||
}
|
||||
|
||||
public static bool Connect()
|
||||
|
||||
@@ -351,7 +351,8 @@ namespace Vocaluxe.Base
|
||||
Params.IncludeDebugInformation = true;
|
||||
#endif
|
||||
|
||||
CodeDomProvider CDP = CodeDomProvider.CreateProvider("CSharp");
|
||||
using (CodeDomProvider CDP = CodeDomProvider.CreateProvider("CSharp"))
|
||||
{
|
||||
CompilerResults CompileResult = null;
|
||||
|
||||
try
|
||||
@@ -374,6 +375,7 @@ namespace Vocaluxe.Base
|
||||
}
|
||||
return CompileResult.CompiledAssembly;
|
||||
}
|
||||
}
|
||||
|
||||
private static CMenuParty GetPartyScreenInstance(Assembly Assembly, string ScreenName, string XmlPath)
|
||||
{
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
if (PlaylistID < 0 || PlaylistID >= _Playlists.Count)
|
||||
return;
|
||||
if (_Playlists[PlaylistID].PlaylistFile != String.Empty)
|
||||
if (_Playlists[PlaylistID].PlaylistFile.Length > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -233,7 +233,8 @@ namespace Vocaluxe.Base
|
||||
try
|
||||
{
|
||||
|
||||
sr = new StreamReader(file, Encoding.Default, true);
|
||||
using (sr = new StreamReader(file, Encoding.Default, true))
|
||||
{
|
||||
|
||||
int pos = -1;
|
||||
string line;
|
||||
@@ -272,7 +273,7 @@ namespace Vocaluxe.Base
|
||||
}
|
||||
}
|
||||
}
|
||||
sr.Close();
|
||||
}
|
||||
File.Delete(file);
|
||||
}
|
||||
catch
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace Vocaluxe.Base
|
||||
profile.GuestProfile = EOffOn.TR_CONFIG_OFF;
|
||||
profile.Active = EOffOn.TR_CONFIG_ON;
|
||||
|
||||
if (FileName != String.Empty)
|
||||
if (FileName.Length > 0)
|
||||
profile.ProfileFile = Path.Combine(CSettings.sFolderProfiles, FileName);
|
||||
else
|
||||
profile.ProfileFile = String.Empty;
|
||||
@@ -253,7 +253,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
if (ProfileID < 0 || ProfileID >= _Profiles.Count)
|
||||
return;
|
||||
if (_Profiles[ProfileID].ProfileFile != String.Empty)
|
||||
if (_Profiles[ProfileID].ProfileFile.Length > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -293,7 +293,7 @@ namespace Vocaluxe.Base
|
||||
if (ProfileID < 0 || ProfileID >= _Profiles.Count)
|
||||
return;
|
||||
|
||||
if (_Profiles[ProfileID].ProfileFile == String.Empty)
|
||||
if (_Profiles[ProfileID].ProfileFile.Length == 0)
|
||||
{
|
||||
string filename = string.Empty;
|
||||
foreach (char chr in _Profiles[ProfileID].PlayerName)
|
||||
@@ -302,7 +302,7 @@ namespace Vocaluxe.Base
|
||||
filename += chr.ToString();
|
||||
}
|
||||
|
||||
if (filename == String.Empty)
|
||||
if (filename.Length == 0)
|
||||
filename = "1";
|
||||
|
||||
int i = 0;
|
||||
@@ -330,12 +330,8 @@ namespace Vocaluxe.Base
|
||||
CLog.LogError("Error creating/opening Profile File " + _Profiles[ProfileID].ProfileFile + ": " + e.Message);
|
||||
return;
|
||||
}
|
||||
|
||||
if (writer == null)
|
||||
try
|
||||
{
|
||||
CLog.LogError("Error creating/opening Profile File " + _Profiles[ProfileID].ProfileFile);
|
||||
return;
|
||||
}
|
||||
|
||||
writer.WriteStartDocument();
|
||||
writer.WriteStartElement("root");
|
||||
@@ -352,7 +348,12 @@ namespace Vocaluxe.Base
|
||||
writer.WriteEndDocument();
|
||||
|
||||
writer.Flush();
|
||||
}
|
||||
finally
|
||||
{
|
||||
writer.Close();
|
||||
writer = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static void LoadProfile(string FileName)
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
string sVersion = sProgramName;
|
||||
|
||||
if (sProgramCodeName != String.Empty)
|
||||
if (sProgramCodeName.Length > 0)
|
||||
sVersion += " \"" + sProgramCodeName + "\"";
|
||||
|
||||
return sVersion += " " + GetVersionText();
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Vocaluxe.Base
|
||||
get { return _SearchFilter; }
|
||||
set
|
||||
{
|
||||
if (value != String.Empty)
|
||||
if (value.Length > 0)
|
||||
{
|
||||
_Sort(_SongSorting, EOffOn.TR_CONFIG_OFF, _IgnoreArticles, value, false, _ShowDuetSongs);
|
||||
}
|
||||
@@ -409,14 +409,14 @@ namespace Vocaluxe.Base
|
||||
_FilteredSongs.Clear();
|
||||
|
||||
string[] searchStrings = null;
|
||||
if (_SearchFilter != String.Empty)
|
||||
if (_SearchFilter.Length > 0)
|
||||
searchStrings = _SearchFilter.ToUpper().Split(new char[] { ' ' });
|
||||
|
||||
foreach (CSong song in _Songs)
|
||||
{
|
||||
if (!song.IsDuet || _ShowDuetSongs)
|
||||
{
|
||||
if (_SearchFilter == String.Empty)
|
||||
if (_SearchFilter.Length == 0)
|
||||
_FilteredSongs.Add(song);
|
||||
else if (searchStrings != null)
|
||||
{
|
||||
@@ -480,7 +480,7 @@ namespace Vocaluxe.Base
|
||||
FieldInfo field = null;
|
||||
bool isString = false;
|
||||
List<SongPointer> SortList = new List<SongPointer>();
|
||||
if (fieldName == String.Empty)
|
||||
if (fieldName.Length == 0)
|
||||
_FilteredSongs.ForEach((song) => SortList.Add(new SongPointer(song.ID, "")));
|
||||
{
|
||||
field = Type.GetType("Vocaluxe.Menu.SongMenu.CSong,VocaluxeLib").GetField(fieldName, BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public);
|
||||
@@ -657,7 +657,7 @@ namespace Vocaluxe.Base
|
||||
for (int i = 0; i < _SongsSortList.Length; i++)
|
||||
{
|
||||
string Year = _SongsSortList[i].SortString;
|
||||
if (Year != "")
|
||||
if (Year.Length > 0)
|
||||
{
|
||||
Year = Year.Substring(0, 3);
|
||||
_SongsSortList[i].SortString = Year + "0 - " + Year + "9";
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace Vocaluxe.Base
|
||||
break;
|
||||
}
|
||||
|
||||
if (file == String.Empty)
|
||||
if (file.Length == 0)
|
||||
return -1;
|
||||
|
||||
int stream = CSound.Load(file);
|
||||
|
||||
@@ -313,7 +313,8 @@ namespace Vocaluxe.Base
|
||||
private static void SaveTheme(int ThemeIndex)
|
||||
{
|
||||
#region ThemeMainFile
|
||||
XmlWriter writer = XmlWriter.Create(Path.Combine(_Themes[ThemeIndex].Path, _Themes[ThemeIndex].FileName), _settings);
|
||||
using (XmlWriter writer = XmlWriter.Create(Path.Combine(_Themes[ThemeIndex].Path, _Themes[ThemeIndex].FileName), _settings))
|
||||
{
|
||||
writer.WriteStartDocument();
|
||||
writer.WriteStartElement("root");
|
||||
|
||||
@@ -346,7 +347,7 @@ namespace Vocaluxe.Base
|
||||
writer.WriteEndDocument();
|
||||
|
||||
writer.Flush();
|
||||
writer.Close();
|
||||
}
|
||||
#endregion ThemeMainFile
|
||||
}
|
||||
|
||||
@@ -354,7 +355,8 @@ namespace Vocaluxe.Base
|
||||
{
|
||||
for (int SkinIndex = 0; SkinIndex < _Skins.Count; SkinIndex++)
|
||||
{
|
||||
XmlWriter writer = XmlWriter.Create(Path.Combine(_Skins[SkinIndex].Path, _Skins[SkinIndex].FileName), _settings);
|
||||
using (XmlWriter writer = XmlWriter.Create(Path.Combine(_Skins[SkinIndex].Path, _Skins[SkinIndex].FileName), _settings))
|
||||
{
|
||||
writer.WriteStartDocument();
|
||||
writer.WriteStartElement("root");
|
||||
|
||||
@@ -400,7 +402,7 @@ namespace Vocaluxe.Base
|
||||
writer.WriteEndDocument();
|
||||
|
||||
writer.Flush();
|
||||
writer.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -439,7 +441,7 @@ namespace Vocaluxe.Base
|
||||
if (version == ThemeSystemVersion)
|
||||
{
|
||||
xmlReader.GetValue("//root/Info/Name", ref theme.Name, String.Empty);
|
||||
if (theme.Name != String.Empty)
|
||||
if (theme.Name.Length > 0)
|
||||
{
|
||||
xmlReader.GetValue("//root/Info/Author", ref theme.Author, String.Empty);
|
||||
xmlReader.GetValue("//root/Info/SkinFolder", ref theme.SkinFolder, String.Empty);
|
||||
@@ -514,7 +516,7 @@ namespace Vocaluxe.Base
|
||||
if (version == SkinSystemVersion)
|
||||
{
|
||||
xmlReader.GetValue("//root/Info/Name", ref skin.Name, String.Empty);
|
||||
if (skin.Name != String.Empty)
|
||||
if (skin.Name.Length > 0)
|
||||
{
|
||||
xmlReader.GetValue("//root/Info/Author", ref skin.Author, String.Empty);
|
||||
xmlReader.TryGetIntValue("//root/Info/SkinVersionMajor", ref skin.SkinVersionMajor);
|
||||
@@ -866,7 +868,7 @@ namespace Vocaluxe.Base
|
||||
writer.WriteElementString("W", Cursor.w.ToString("#0.000"));
|
||||
writer.WriteElementString("H", Cursor.h.ToString("#0.000"));
|
||||
|
||||
if (Cursor.color != String.Empty)
|
||||
if (Cursor.color.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("Color", Cursor.color);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
// Diese Datei wird von der Codeanalyse zur Wartung der SuppressMessage-
|
||||
// Attribute verwendet, die auf dieses Projekt angewendet werden.
|
||||
// Unterdrückungen auf Projektebene haben entweder kein Ziel oder
|
||||
// erhalten ein spezifisches Ziel mit Namespace-, Typ-, Memberbereich usw.
|
||||
//
|
||||
// Wenn Sie dieser Datei eine Unterdrückung hinzufügen möchten, klicken Sie mit der
|
||||
// rechten Maustaste auf die Meldung in der Fehlerliste, zeigen Sie auf
|
||||
// "Meldung(en) unterdrücken", und klicken Sie auf "In Projektunterdrückungsdatei".
|
||||
// Sie müssen dieser Datei nicht manuell Unterdrückungen hinzufügen.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", MessageId = "System.Reflection.Assembly.LoadFrom", Scope = "member", Target = "Vocaluxe.MainProgram.#AssemblyResolver(System.Object,System.ResolveEventArgs)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Objekte verwerfen, bevor Bereich verloren geht", Scope = "member", Target = "Vocaluxe.Lib.Draw.CDrawWinForm.#ColorizeBitmap(System.Drawing.Bitmap,Vocaluxe.Menu.SColorF)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Objekte verwerfen, bevor Bereich verloren geht", Scope = "member", Target = "Vocaluxe.Lib.Draw.CDrawWinForm.#CopyScreen(Vocaluxe.Menu.STexture&)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Objekte verwerfen, bevor Bereich verloren geht", Scope = "member", Target = "Vocaluxe.Base.CGlyph.#.ctor(System.Char,System.Single)")]
|
||||
@@ -493,13 +493,14 @@ namespace Vocaluxe.Lib.Draw
|
||||
|
||||
//This creates a new white texture and adds it to the texture pool
|
||||
//This texture is used for the DrawRect method
|
||||
Bitmap blankMap = new Bitmap(1, 1);
|
||||
using (Bitmap blankMap = new Bitmap(1, 1))
|
||||
{
|
||||
Graphics g = Graphics.FromImage(blankMap);
|
||||
g.Clear(Color.White);
|
||||
g.Dispose();
|
||||
_BlankTexture = AddTexture(blankMap);
|
||||
|
||||
blankMap.Dispose();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -560,7 +561,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
}
|
||||
}
|
||||
//Apply fullscreen mode
|
||||
if ((CSettings.bFullScreen && !_fullscreen) || (!CSettings.bFullScreen && _fullscreen))
|
||||
if (CSettings.bFullScreen != _fullscreen)
|
||||
{
|
||||
if (!_fullscreen)
|
||||
EnterFullScreen();
|
||||
@@ -576,9 +577,8 @@ namespace Vocaluxe.Lib.Draw
|
||||
CTime.CalculateFPS();
|
||||
CTime.Restart();
|
||||
}
|
||||
else
|
||||
this.Close();
|
||||
}
|
||||
this.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -881,8 +881,15 @@ namespace Vocaluxe.Lib.Draw
|
||||
CLog.LogError("Error loading Texture: " + TexturePath);
|
||||
return new STexture(-1);
|
||||
}
|
||||
STexture s = AddTexture(bmp, TexturePath);
|
||||
STexture s;
|
||||
try
|
||||
{
|
||||
s = AddTexture(bmp, TexturePath);
|
||||
}
|
||||
finally
|
||||
{
|
||||
bmp.Dispose();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
CLog.LogError("Can't find File: " + TexturePath);
|
||||
|
||||
@@ -246,9 +246,8 @@ namespace Vocaluxe.Lib.Draw
|
||||
CTime.CalculateFPS();
|
||||
CTime.Restart();
|
||||
}
|
||||
else
|
||||
this.Close();
|
||||
}
|
||||
this.Close();
|
||||
}
|
||||
|
||||
public bool Unload()
|
||||
@@ -396,10 +395,12 @@ namespace Vocaluxe.Lib.Draw
|
||||
|
||||
if (!found)
|
||||
{
|
||||
Bitmap bmp = new Bitmap(TexturePath);
|
||||
using (Bitmap bmp = new Bitmap(TexturePath))
|
||||
{
|
||||
return AddTexture(bmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return texture;
|
||||
}
|
||||
@@ -433,12 +434,14 @@ namespace Vocaluxe.Lib.Draw
|
||||
|
||||
public STexture AddTexture(int W, int H, ref byte[] Data)
|
||||
{
|
||||
Bitmap bmp = new Bitmap(W, H);
|
||||
using (Bitmap bmp = new Bitmap(W, H))
|
||||
{
|
||||
BitmapData bmp_data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadWrite, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||
Marshal.Copy(Data, 0, bmp_data.Scan0, Data.Length);
|
||||
bmp.UnlockBits(bmp_data);
|
||||
return AddTexture(bmp);
|
||||
}
|
||||
}
|
||||
|
||||
public bool UpdateTexture(ref STexture Texture, IntPtr Data)
|
||||
{
|
||||
@@ -525,7 +528,8 @@ namespace Vocaluxe.Lib.Draw
|
||||
{
|
||||
Bitmap newBitmap = new Bitmap(original.Width, original.Height);
|
||||
|
||||
Graphics g = Graphics.FromImage(newBitmap);
|
||||
using (Graphics g = Graphics.FromImage(newBitmap))
|
||||
{
|
||||
|
||||
ColorMatrix cm = new ColorMatrix();
|
||||
cm.Matrix33 = color.A;
|
||||
@@ -534,14 +538,15 @@ namespace Vocaluxe.Lib.Draw
|
||||
cm.Matrix22 = color.B;
|
||||
cm.Matrix44 = 1;
|
||||
|
||||
ImageAttributes ia = new ImageAttributes();
|
||||
using (ImageAttributes ia = new ImageAttributes())
|
||||
{
|
||||
ia.SetColorMatrix(cm);
|
||||
|
||||
g.DrawImage(original, new Rectangle(0, 0, original.Width, original.Height),
|
||||
0, 0, original.Width, original.Height, GraphicsUnit.Pixel, ia);
|
||||
|
||||
ia.Dispose();
|
||||
g.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
return newBitmap;
|
||||
}
|
||||
|
||||
@@ -500,9 +500,8 @@ namespace Vocaluxe.Lib.Draw
|
||||
CTime.CalculateFPS();
|
||||
CTime.Restart();
|
||||
}
|
||||
else
|
||||
this.Close();
|
||||
}
|
||||
this.Close();
|
||||
}
|
||||
|
||||
public bool Unload()
|
||||
@@ -617,7 +616,8 @@ namespace Vocaluxe.Lib.Draw
|
||||
int width = GetScreenWidth();
|
||||
int height = GetScreenHeight();
|
||||
|
||||
Bitmap screen = new Bitmap(width, height);
|
||||
using (Bitmap screen = new Bitmap(width, height))
|
||||
{
|
||||
|
||||
|
||||
BitmapData bmp_data = screen.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||
@@ -627,7 +627,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
|
||||
screen.RotateFlip(RotateFlipType.RotateNoneFlipY);
|
||||
screen.Save(Path.Combine(path, file + i.ToString("00000") + ".bmp"), ImageFormat.Bmp);
|
||||
screen.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public void DrawLine(int a, int r, int g, int b, int w, int x1, int y1, int x2, int y2)
|
||||
@@ -799,7 +799,8 @@ namespace Vocaluxe.Lib.Draw
|
||||
texture.w2 = (float)MathHelper.NextPowerOfTwo(w);
|
||||
texture.h2 = (float)MathHelper.NextPowerOfTwo(h);
|
||||
|
||||
Bitmap bmp2 = new Bitmap((int)texture.w2, (int)texture.h2);
|
||||
using (Bitmap bmp2 = new Bitmap((int)texture.w2, (int)texture.h2))
|
||||
{
|
||||
Graphics g = Graphics.FromImage(bmp2);
|
||||
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
|
||||
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
|
||||
@@ -819,7 +820,7 @@ namespace Vocaluxe.Lib.Draw
|
||||
OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, bmp_data.Scan0);
|
||||
|
||||
bmp2.UnlockBits(bmp_data);
|
||||
bmp2.Dispose();
|
||||
}
|
||||
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureParameterName.ClampToEdge);
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureParameterName.ClampToEdge);
|
||||
|
||||
@@ -675,7 +675,10 @@ namespace Vocaluxe.Lib.Input.WiiMote
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
Disconnect();
|
||||
_ReadDone.Close();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Vocaluxe.Lib.Playlist
|
||||
|
||||
public void SavePlaylist()
|
||||
{
|
||||
if (PlaylistFile == string.Empty)
|
||||
if (PlaylistFile.Length == 0)
|
||||
{
|
||||
string filename = string.Empty;
|
||||
foreach (char chr in PlaylistName)
|
||||
@@ -52,7 +52,7 @@ namespace Vocaluxe.Lib.Playlist
|
||||
filename += chr.ToString();
|
||||
}
|
||||
|
||||
if (filename == String.Empty)
|
||||
if (filename.Length == 0)
|
||||
filename = "1";
|
||||
|
||||
int i = 0;
|
||||
@@ -85,6 +85,8 @@ namespace Vocaluxe.Lib.Playlist
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
writer.WriteStartDocument();
|
||||
writer.WriteStartElement("root");
|
||||
|
||||
@@ -115,8 +117,12 @@ namespace Vocaluxe.Lib.Playlist
|
||||
writer.WriteEndDocument();
|
||||
|
||||
writer.Flush();
|
||||
}
|
||||
finally
|
||||
{
|
||||
writer.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadPlaylist()
|
||||
{
|
||||
|
||||
@@ -36,7 +36,8 @@ namespace Vocaluxe.Lib.Sound
|
||||
int id = 0;
|
||||
foreach (DeviceInformation dev in devices)
|
||||
{
|
||||
DirectSoundCapture ds = new DirectSoundCapture(dev.DriverGuid);
|
||||
using (DirectSoundCapture ds = new DirectSoundCapture(dev.DriverGuid))
|
||||
{
|
||||
|
||||
SRecordDevice device = new SRecordDevice();
|
||||
device.Driver = dev.DriverGuid.ToString();
|
||||
@@ -55,7 +56,7 @@ namespace Vocaluxe.Lib.Sound
|
||||
_Devices.Add(device);
|
||||
|
||||
id++;
|
||||
ds.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
_DeviceConfig = _Devices.ToArray();
|
||||
@@ -68,11 +69,7 @@ namespace Vocaluxe.Lib.Sound
|
||||
{
|
||||
if (_initialized)
|
||||
{
|
||||
foreach (SoundCardSource source in _Sources)
|
||||
{
|
||||
source.Stop();
|
||||
source.Dispose();
|
||||
}
|
||||
Stop();
|
||||
_initialized = false;
|
||||
}
|
||||
//System.IO.File.WriteAllBytes("test0.raw", _Buffer[0].Buffer);
|
||||
@@ -131,7 +128,10 @@ namespace Vocaluxe.Lib.Sound
|
||||
foreach (SoundCardSource source in _Sources)
|
||||
{
|
||||
source.Stop();
|
||||
source.Dispose();
|
||||
}
|
||||
_Sources.Clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
public void AnalyzeBuffer(int Player)
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace Vocaluxe.Lib.Webcam
|
||||
return false;
|
||||
|
||||
//No MonikerString found, try first webcam
|
||||
if (Config.MonikerString == String.Empty)
|
||||
if (Config.MonikerString.Length == 0)
|
||||
_Webcam = new VideoCaptureDevice(_WebcamDevices[0].MonikerString);
|
||||
else //Found MonikerString
|
||||
_Webcam = new VideoCaptureDevice(Config.MonikerString);
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die mit einer Assembly verknüpft sind.
|
||||
[assembly: AssemblyTitle("Vocaluxe.Properties")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Vocaluxe.Properties")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2013")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
|
||||
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("da631594-f891-4994-9869-c37e626e44f9")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.3.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -597,7 +597,7 @@ namespace Vocaluxe.Screens
|
||||
for (int i = 0; i < CSettings.MaxNumPlayer; i++)
|
||||
{
|
||||
//Update texture and name
|
||||
if (CConfig.Players[i] != String.Empty)
|
||||
if (CConfig.Players[i].Length > 0)
|
||||
{
|
||||
Statics[htStatics(StaticPlayerAvatar[i])].Texture = CProfiles.Profiles[CGame.Player[i].ProfileID].Avatar.Texture;
|
||||
Texts[htTexts(TextPlayer[i])].Text = CProfiles.Profiles[CGame.Player[i].ProfileID].PlayerName;
|
||||
@@ -692,7 +692,7 @@ namespace Vocaluxe.Screens
|
||||
Statics[htStatics("StaticPlayer" + i)].Visible = true;
|
||||
Statics[htStatics("StaticPlayerAvatar" + i)].Visible = true;
|
||||
Texts[htTexts("TextPlayer" + i)].Visible = true;
|
||||
if (Texts[htTexts("TextPlayer" + i)].Text == string.Empty)
|
||||
if (Texts[htTexts("TextPlayer" + i)].Text.Length == 0)
|
||||
{
|
||||
Texts[htTexts("TextPlayer" + i)].Text = CLanguage.Translate("TR_SCREENNAMES_PLAYER") + " " + i.ToString();
|
||||
}
|
||||
|
||||
@@ -622,7 +622,7 @@ namespace Vocaluxe.Screens
|
||||
|
||||
CDraw.RemoveTexture(ref _CurrentVideoTexture);
|
||||
|
||||
if (song.VideoFileName != String.Empty)
|
||||
if (song.VideoFileName.Length > 0)
|
||||
{
|
||||
_CurrentVideo = CVideo.VdLoad(Path.Combine(song.Folder, song.VideoFileName));
|
||||
CVideo.VdSkip(_CurrentVideo, song.Start, song.VideoGap);
|
||||
@@ -630,7 +630,7 @@ namespace Vocaluxe.Screens
|
||||
}
|
||||
|
||||
CDraw.RemoveTexture(ref _Background);
|
||||
if (song.BackgroundFileName != String.Empty)
|
||||
if (song.BackgroundFileName.Length > 0)
|
||||
_Background = CDraw.AddTexture(Path.Combine(song.Folder, song.BackgroundFileName));
|
||||
|
||||
SingNotes[htSingNotes(SingBars)].Reset();
|
||||
|
||||
@@ -1105,13 +1105,13 @@ namespace Vocaluxe.Screens
|
||||
SongID = CSongs.VisibleSongs[SongIndex].ID;
|
||||
}
|
||||
|
||||
if (NewFilterString == String.Empty && _sso.Sorting.Tabs == EOffOn.TR_CONFIG_ON)
|
||||
if (NewFilterString.Length == 0 && _sso.Sorting.Tabs == EOffOn.TR_CONFIG_ON)
|
||||
{
|
||||
CSongs.Category = -1;
|
||||
refresh = true;
|
||||
}
|
||||
|
||||
if (NewFilterString != String.Empty && CSongs.Category != 0)
|
||||
if (NewFilterString.Length > 0 && CSongs.Category != 0)
|
||||
{
|
||||
CSongs.Category = 0;
|
||||
refresh = true;
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||
<CodeAnalysisRuleSet>..\CheckingRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseWin|x64'">
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
@@ -193,6 +194,7 @@
|
||||
<Compile Include="GameModes\CGameMode.cs" />
|
||||
<Compile Include="GameModes\CGameModeNormal.cs" />
|
||||
<Compile Include="GameModes\IGameMode.cs" />
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="Lib\Draw\CDirect3D.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// Diese Datei wird von der Codeanalyse zur Wartung der SuppressMessage-
|
||||
// Attribute verwendet, die auf dieses Projekt angewendet werden.
|
||||
// Unterdrückungen auf Projektebene haben entweder kein Ziel oder
|
||||
// erhalten ein spezifisches Ziel mit Namespace-, Typ-, Memberbereich usw.
|
||||
//
|
||||
// Wenn Sie dieser Datei eine Unterdrückung hinzufügen möchten, klicken Sie mit der
|
||||
// rechten Maustaste auf die Meldung in der Fehlerliste, zeigen Sie auf
|
||||
// "Meldung(en) unterdrücken", und klicken Sie auf "In Projektunterdrückungsdatei".
|
||||
// Sie müssen dieser Datei nicht manuell Unterdrückungen hinzufügen.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId = "Vocaluxe.Menu.CHelper.TryParse(System.String,System.Single@)", Scope = "member", Target = "Vocaluxe.Menu.SongMenu.CSong.#ReadHeader(System.String)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId = "System.Int32.TryParse(System.String,System.Int32@)", Scope = "member", Target = "Vocaluxe.Menu.SongMenu.CSong.#ReadNotes(System.String,System.Boolean)")]
|
||||
@@ -104,7 +104,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Background color for type \"Color\" from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
}
|
||||
@@ -127,13 +127,13 @@ namespace Vocaluxe.Menu
|
||||
|
||||
public void Resume()
|
||||
{
|
||||
if (_Theme.Type == EBackgroundTypes.Video && _Theme.VideoName != String.Empty && CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_ON)
|
||||
if (_Theme.Type == EBackgroundTypes.Video && _Theme.VideoName.Length > 0 && CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_ON)
|
||||
CBase.Theme.SkinVideoResume(_Theme.VideoName, _PartyModeID);
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
{
|
||||
if (_Theme.VideoName != String.Empty)
|
||||
if (_Theme.VideoName.Length > 0)
|
||||
CBase.Theme.SkinVideoPause(_Theme.VideoName, _PartyModeID);
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace Vocaluxe.Menu
|
||||
ok = DrawVideo();
|
||||
}
|
||||
|
||||
if (_Theme.TextureName != String.Empty &&
|
||||
if (_Theme.TextureName.Length > 0 &&
|
||||
(_Theme.Type == EBackgroundTypes.Texture ||
|
||||
(_Theme.Type == EBackgroundTypes.Video && (CBase.Config.GetVideoBackgrounds() == EOffOn.TR_CONFIG_OFF || !ok))))
|
||||
ok = DrawTexture();
|
||||
@@ -171,7 +171,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Button color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
}
|
||||
@@ -241,7 +241,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<SColor>: Selected button color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
|
||||
if (_Theme.SColorName != String.Empty)
|
||||
if (_Theme.SColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("SColor", _Theme.SColorName);
|
||||
}
|
||||
@@ -370,10 +370,10 @@ namespace Vocaluxe.Menu
|
||||
{
|
||||
Text.LoadTextures();
|
||||
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SColorName != String.Empty)
|
||||
if (_Theme.SColorName.Length > 0)
|
||||
SColor = CBase.Theme.GetColor(_Theme.SColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Equalizer color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
}
|
||||
@@ -178,7 +178,7 @@ namespace Vocaluxe.Menu
|
||||
}
|
||||
writer.WriteComment("<MaxColor>: Equalizer color for maximal volume from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <MaxR>, <MaxG>, <MaxB>, <MaxA> (lower priority)");
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("MaxColor", _Theme.ColorName);
|
||||
}
|
||||
@@ -273,10 +273,10 @@ namespace Vocaluxe.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.MaxColorName != String.Empty)
|
||||
if (_Theme.MaxColorName.Length > 0)
|
||||
MaxColor = CBase.Theme.GetColor(_Theme.MaxColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,8 +73,9 @@ namespace Vocaluxe.Menu
|
||||
return 0;
|
||||
}
|
||||
int result = 0;
|
||||
int.TryParse(value, out result);
|
||||
if(int.TryParse(value, out result))
|
||||
return result;
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void SetRect(RectangleF Bounds, ref RectangleF Rect, float RectAspect, EAspect Aspect)
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Lyric text color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
}
|
||||
@@ -178,7 +178,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<SColor>: Highlighted lyric color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
|
||||
if (_Theme.SColorName != String.Empty)
|
||||
if (_Theme.SColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("SColor", _Theme.SColorName);
|
||||
}
|
||||
@@ -547,10 +547,10 @@ namespace Vocaluxe.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SColorName != String.Empty)
|
||||
if (_Theme.SColorName.Length > 0)
|
||||
ColorProcessed = CBase.Theme.GetColor(_Theme.SColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -409,7 +409,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
public virtual void SaveTheme()
|
||||
{
|
||||
if (_ThemePath == String.Empty)
|
||||
if (_ThemePath.Length == 0)
|
||||
return;
|
||||
|
||||
XmlWriterSettings settings = new XmlWriterSettings();
|
||||
@@ -418,7 +418,8 @@ namespace Vocaluxe.Menu
|
||||
settings.ConformanceLevel = ConformanceLevel.Document;
|
||||
|
||||
string file = Path.Combine(_ThemePath, _ThemeName + ".xml");
|
||||
XmlWriter writer = XmlWriter.Create(file, settings);
|
||||
using (XmlWriter writer = XmlWriter.Create(file, settings))
|
||||
{
|
||||
|
||||
writer.WriteStartDocument();
|
||||
writer.WriteStartElement("root");
|
||||
@@ -509,7 +510,7 @@ namespace Vocaluxe.Menu
|
||||
writer.WriteEndDocument();
|
||||
|
||||
writer.Flush();
|
||||
writer.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ReloadTextures()
|
||||
@@ -649,7 +650,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
public virtual void ReloadTheme(string XmlPath)
|
||||
{
|
||||
if (_ThemePath == String.Empty)
|
||||
if (_ThemePath.Length == 0)
|
||||
return;
|
||||
|
||||
UnloadTextures();
|
||||
|
||||
@@ -182,7 +182,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<ColorEmptyTile>: Static color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorEmptyTileName != String.Empty)
|
||||
if (_Theme.ColorEmptyTileName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("ColorEmptyTile", _Theme.ColorEmptyTileName);
|
||||
}
|
||||
@@ -215,7 +215,7 @@ namespace Vocaluxe.Menu
|
||||
writer.WriteComment("<Font>: Text font name");
|
||||
writer.WriteElementString("Font", _Theme.NameFont);
|
||||
writer.WriteComment("<Color>: Text color from ColorScheme (high priority)");
|
||||
if (_Theme.NameColorName != String.Empty)
|
||||
if (_Theme.NameColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("Color", _Theme.NameColorName);
|
||||
}
|
||||
@@ -474,10 +474,10 @@ namespace Vocaluxe.Menu
|
||||
_TextureEmptyTile = CBase.Theme.GetSkinTexture(_Theme.TextureEmptyTileName, _PartyModeID);
|
||||
_TextureTileSelected = CBase.Theme.GetSkinTexture(_Theme.TextureTileSelectedName, _PartyModeID);
|
||||
|
||||
if (_Theme.ColorEmptyTileName != String.Empty)
|
||||
if (_Theme.ColorEmptyTileName.Length > 0)
|
||||
ColorEmptyTile = CBase.Theme.GetColor(_Theme.ColorEmptyTileName, _PartyModeID);
|
||||
|
||||
if (_Theme.NameColorName != String.Empty)
|
||||
if (_Theme.NameColorName.Length > 0)
|
||||
_Theme.NameColor = CBase.Theme.GetColor(_Theme.NameColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Vocaluxe.Menu
|
||||
Init();
|
||||
}
|
||||
|
||||
protected virtual void Init()
|
||||
protected void Init()
|
||||
{
|
||||
_Interactions = new List<CInteraction>();
|
||||
_Selection = 0;
|
||||
|
||||
@@ -287,7 +287,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
if (_TextureName != String.Empty)
|
||||
if (_TextureName.Length > 0)
|
||||
CBase.Drawing.DrawTexture(CBase.Theme.GetSkinTexture(_TextureName, _PartyModeID), _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha));
|
||||
else
|
||||
CBase.Drawing.DrawTexture(_Texture, _Rect, new SColorF(_Color.R, _Color.G, _Color.B, _Color.A * Alpha2 * _Alpha));
|
||||
@@ -428,7 +428,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<Color>: ParticleEffect color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
}
|
||||
@@ -544,7 +544,7 @@ namespace Vocaluxe.Menu
|
||||
h = 0;
|
||||
|
||||
CParticle star;
|
||||
if (_Theme.TextureName != String.Empty)
|
||||
if (_Theme.TextureName.Length > 0)
|
||||
{
|
||||
star = new CParticle(_PartyModeID, _Theme.TextureName, Color,
|
||||
CBase.Game.GetRandom(w) + Rect.X - size / 4f,
|
||||
@@ -611,9 +611,9 @@ namespace Vocaluxe.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
if(_Theme.TextureName != String.Empty)
|
||||
if(_Theme.TextureName.Length > 0)
|
||||
Texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -360,7 +360,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<ColorBackground>: Button color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <BackgroundR>, <BackgroundG>, <BackgroundB>, <BackgroundA> (lower priority)");
|
||||
if (_Theme.ColorBackgroundName != String.Empty)
|
||||
if (_Theme.ColorBackgroundName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("ColorBackground", _Theme.ColorBackgroundName);
|
||||
}
|
||||
@@ -374,7 +374,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<SColorBackground>: Selected paylist-entry color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <SBackgroundR>, <SBackgroundG>, <SBackgroundB>, <SBackgroundA> (lower priority)");
|
||||
if (_Theme.SColorBackgroundName != String.Empty)
|
||||
if (_Theme.SColorBackgroundName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("SColorBackground", _Theme.SColorBackgroundName);
|
||||
}
|
||||
@@ -467,10 +467,10 @@ namespace Vocaluxe.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorBackgroundName != String.Empty)
|
||||
if (_Theme.ColorBackgroundName.Length > 0)
|
||||
BackgroundColor = CBase.Theme.GetColor(_Theme.ColorBackgroundName, _PartyModeID);
|
||||
|
||||
if (_Theme.SColorBackgroundName != String.Empty)
|
||||
if (_Theme.SColorBackgroundName.Length > 0)
|
||||
BackgroundSColor = CBase.Theme.GetColor(_Theme.SColorBackgroundName, _PartyModeID);
|
||||
|
||||
_Theme.Text1.LoadTextures();
|
||||
|
||||
@@ -413,7 +413,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<Color>: SelectSlide color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
}
|
||||
@@ -427,7 +427,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<SColor>: Selected SelectSlide color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
|
||||
if (_Theme.SColorName != String.Empty)
|
||||
if (_Theme.SColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("SColor", _Theme.SColorName);
|
||||
}
|
||||
@@ -441,7 +441,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<HColor>: Highlighted SelectSlide color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <HR>, <HG>, <HB>, <HA> (lower priority)");
|
||||
if (_Theme.HColorName != String.Empty)
|
||||
if (_Theme.HColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("HColor", _Theme.HColorName);
|
||||
}
|
||||
@@ -455,7 +455,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<ArrowColor>: Arrow color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <ArrowR>, <ArrowG>, <ArrowB>, <ArrowA> (lower priority)");
|
||||
if (_Theme.ArrowColorName != String.Empty)
|
||||
if (_Theme.ArrowColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("ArrowColor", _Theme.ArrowColorName);
|
||||
}
|
||||
@@ -469,7 +469,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<ArrowSColor>: Selected arrow color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <ArrowSR>, <ArrowSG>, <ArrowSB>, <ArrowSA> (lower priority)");
|
||||
if (_Theme.SArrowColorName != String.Empty)
|
||||
if (_Theme.SArrowColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("ArrowSColor", _Theme.SArrowColorName);
|
||||
}
|
||||
@@ -483,7 +483,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<TextColor>: Text color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <TextR>, <TextG>, <TextB>, <TextA> (lower priority)");
|
||||
if (_Theme.TextColorName != String.Empty)
|
||||
if (_Theme.TextColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("TextColor", _Theme.TextColorName);
|
||||
}
|
||||
@@ -497,7 +497,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<TextSColor>: Selected text color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)");
|
||||
if (_Theme.STextColorName != String.Empty)
|
||||
if (_Theme.STextColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("TextSColor", _Theme.STextColorName);
|
||||
}
|
||||
@@ -817,25 +817,25 @@ namespace Vocaluxe.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SColorName != String.Empty)
|
||||
if (_Theme.SColorName.Length > 0)
|
||||
SColor = CBase.Theme.GetColor(_Theme.SColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.HColorName != String.Empty)
|
||||
if (_Theme.HColorName.Length > 0)
|
||||
HColor = CBase.Theme.GetColor(_Theme.HColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.ArrowColorName != String.Empty)
|
||||
if (_Theme.ArrowColorName.Length > 0)
|
||||
ColorArrow = CBase.Theme.GetColor(_Theme.ArrowColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SArrowColorName != String.Empty)
|
||||
if (_Theme.SArrowColorName.Length > 0)
|
||||
SColorArrow = CBase.Theme.GetColor(_Theme.SArrowColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.TextColorName != String.Empty)
|
||||
if (_Theme.TextColorName.Length > 0)
|
||||
TextColor = CBase.Theme.GetColor(_Theme.TextColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SColorName != String.Empty)
|
||||
if (_Theme.SColorName.Length > 0)
|
||||
STextColor = CBase.Theme.GetColor(_Theme.STextColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Static color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
}
|
||||
@@ -286,7 +286,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
|
||||
@@ -576,7 +576,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<Color>: Text color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
}
|
||||
@@ -590,7 +590,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
writer.WriteComment("<SColor>: Selected Text color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <SR>, <SG>, <SB>, <SA> (lower priority)");
|
||||
if (_Theme.SColorName != String.Empty)
|
||||
if (_Theme.SColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("SColor", _Theme.SColorName);
|
||||
}
|
||||
@@ -849,10 +849,10 @@ namespace Vocaluxe.Menu
|
||||
|
||||
public void LoadTextures()
|
||||
{
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
|
||||
if (_Theme.SColorName != String.Empty)
|
||||
if (_Theme.SColorName.Length > 0)
|
||||
SColor = CBase.Theme.GetColor(_Theme.SColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
@@ -879,7 +879,7 @@ namespace Vocaluxe.Menu
|
||||
|
||||
private void UpdateTextPosition()
|
||||
{
|
||||
if (_Text == String.Empty)
|
||||
if (_Text.Length == 0)
|
||||
return;
|
||||
|
||||
CBase.Fonts.SetFont(Fon);
|
||||
|
||||
@@ -330,7 +330,7 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
this.FileName = Path.GetFileName(FilePath);
|
||||
|
||||
EHeaderFlags HeaderFlags = new EHeaderFlags();
|
||||
StreamReader sr;
|
||||
StreamReader sr = null;
|
||||
try
|
||||
{
|
||||
|
||||
@@ -362,6 +362,8 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
{
|
||||
case "ENCODING":
|
||||
this.Encoding = CEncoding.GetEncoding(Value);
|
||||
sr.Dispose();
|
||||
sr = null;
|
||||
sr = new StreamReader(FilePath, this.Encoding);
|
||||
Identifier = String.Empty;
|
||||
|
||||
@@ -384,39 +386,39 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
}
|
||||
break;
|
||||
case "TITLE":
|
||||
if (Value != String.Empty)
|
||||
if (Value.Length > 0)
|
||||
{
|
||||
this.Title = Value;
|
||||
HeaderFlags |= EHeaderFlags.Title;
|
||||
}
|
||||
break;
|
||||
case "ARTIST":
|
||||
if (Value != String.Empty)
|
||||
if (Value.Length > 0)
|
||||
{
|
||||
this.Artist = Value;
|
||||
HeaderFlags |= EHeaderFlags.Artist;
|
||||
}
|
||||
break;
|
||||
case "TITLE-ON-SORTING":
|
||||
if (Value != String.Empty)
|
||||
if (Value.Length > 0)
|
||||
{
|
||||
this.TitleSorting = Value;
|
||||
}
|
||||
break;
|
||||
case "ARTIST-ON-SORTING":
|
||||
if (Value != String.Empty)
|
||||
if (Value.Length > 0)
|
||||
{
|
||||
this.ArtistSorting = Value;
|
||||
}
|
||||
break;
|
||||
case "P1":
|
||||
if (Value != String.Empty)
|
||||
if (Value.Length > 0)
|
||||
{
|
||||
this.DuetPart1 = Value;
|
||||
}
|
||||
break;
|
||||
case "P2":
|
||||
if (Value != String.Empty)
|
||||
if (Value.Length > 0)
|
||||
{
|
||||
this.DuetPart2 = Value;
|
||||
}
|
||||
@@ -586,19 +588,21 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (sr != null)
|
||||
sr.Dispose();
|
||||
CBase.Log.LogError("Error reading txt header in file \"" + FilePath + "\": " + e.Message);
|
||||
return false;
|
||||
}
|
||||
|
||||
sr.Dispose();
|
||||
CheckFiles();
|
||||
|
||||
//Before saving this tags to .txt: Check, if ArtistSorting and Artist are equal, then don't save this tag.
|
||||
if (this.ArtistSorting == String.Empty)
|
||||
if (this.ArtistSorting.Length == 0)
|
||||
{
|
||||
this.ArtistSorting = this.Artist;
|
||||
}
|
||||
|
||||
if (this.TitleSorting == String.Empty)
|
||||
if (this.TitleSorting.Length == 0)
|
||||
{
|
||||
this.TitleSorting = this.Title;
|
||||
}
|
||||
@@ -634,7 +638,7 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
int Player = 0;
|
||||
int FileLineNo = 0;
|
||||
|
||||
StreamReader sr;
|
||||
StreamReader sr = null;
|
||||
try
|
||||
{
|
||||
|
||||
@@ -776,8 +780,11 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
catch (Exception e)
|
||||
{
|
||||
CBase.Log.LogError("Error loading song. Line No.: " + FileLineNo.ToString() + ". An unhandled exception occured (" + e.Message + "): " + FilePath);
|
||||
if(sr != null)
|
||||
sr.Dispose();
|
||||
return false;
|
||||
}
|
||||
sr.Dispose();
|
||||
FindRefrain();
|
||||
FindShortEnd();
|
||||
_NotesLoaded = true;
|
||||
@@ -805,7 +812,7 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
{
|
||||
if (_CoverSmallLoaded)
|
||||
return;
|
||||
if (this.CoverFileName != String.Empty)
|
||||
if (this.CoverFileName.Length > 0)
|
||||
{
|
||||
if (!CBase.DataBase.GetCover(Path.Combine(this.Folder, this.CoverFileName), ref _CoverTextureSmall, CBase.Config.GetCoverSize()))
|
||||
_CoverTextureSmall = CBase.Cover.GetNoCover();
|
||||
@@ -818,7 +825,7 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
|
||||
private void CheckFiles()
|
||||
{
|
||||
if(this.CoverFileName == String.Empty){
|
||||
if(this.CoverFileName.Length == 0){
|
||||
List<string> files = CHelper.ListFiles(this.Folder, "*.jpg", false);
|
||||
files.AddRange(CHelper.ListFiles(this.Folder, "*.png", false));
|
||||
foreach(String file in files)
|
||||
@@ -830,7 +837,7 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
}
|
||||
}
|
||||
|
||||
if (this.BackgroundFileName == String.Empty)
|
||||
if (this.BackgroundFileName.Length == 0)
|
||||
{
|
||||
List<string> files = CHelper.ListFiles(this.Folder, "*.jpg", false);
|
||||
files.AddRange(CHelper.ListFiles(this.Folder, "*.png", false));
|
||||
@@ -847,12 +854,12 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
|
||||
private void CheckDuet()
|
||||
{
|
||||
if (DuetPart1 == String.Empty)
|
||||
if (DuetPart1.Length == 0)
|
||||
{
|
||||
DuetPart1 = "Part 1";
|
||||
CBase.Log.LogError("Warning: Can't find #P1-tag for duets in \"" + this.Artist + " - " + this.Title + "\".");
|
||||
}
|
||||
if (DuetPart2 == String.Empty)
|
||||
if (DuetPart2.Length == 0)
|
||||
{
|
||||
DuetPart2 = "Part 2";
|
||||
CBase.Log.LogError("Warning: Can't find #P2-tag for duets in \"" + this.Artist + " - " + this.Title + "\".");
|
||||
@@ -889,7 +896,7 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
{
|
||||
for (int j = i + 1; j < lines.LineCount; j++)
|
||||
{
|
||||
if (sentences[i] == sentences[j] && sentences[i] != String.Empty)
|
||||
if (sentences[i] == sentences[j] && sentences[i].Length > 0)
|
||||
{
|
||||
Series tempSeries = new Series();
|
||||
tempSeries.start = i;
|
||||
@@ -903,7 +910,7 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
|
||||
for (int k = 1; k <= max; k++)
|
||||
{
|
||||
if (sentences[i + k] == sentences[j + k] && sentences[i + k] != String.Empty)
|
||||
if (sentences[i + k] == sentences[j + k] && sentences[i + k].Length > 0)
|
||||
tempSeries.end = i + k;
|
||||
else
|
||||
break;
|
||||
|
||||
@@ -350,7 +350,7 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
|
||||
writer.WriteComment("<Color>: Tile color from ColorScheme (high priority)");
|
||||
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
{
|
||||
writer.WriteElementString("Color", _Theme.ColorName);
|
||||
}
|
||||
@@ -578,7 +578,7 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
{
|
||||
Init();
|
||||
|
||||
if (_Theme.ColorName != String.Empty)
|
||||
if (_Theme.ColorName.Length > 0)
|
||||
_Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
|
||||
}
|
||||
|
||||
@@ -652,7 +652,7 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
_streams.Add(_stream);
|
||||
_actsongstream = _stream;
|
||||
|
||||
if (CBase.Songs.GetVisibleSong(_actsong).VideoFileName != String.Empty && CBase.Config.GetVideoPreview() == EOffOn.TR_CONFIG_ON)
|
||||
if (CBase.Songs.GetVisibleSong(_actsong).VideoFileName.Length > 0 && 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)
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace Vocaluxe.Menu.SongMenu
|
||||
_MedleyTagIcon.Visible = false;
|
||||
}
|
||||
|
||||
if (CBase.Songs.GetNumVisibleSongs() == 0 && CBase.Songs.GetSearchFilter() != String.Empty)
|
||||
if (CBase.Songs.GetNumVisibleSongs() == 0 && CBase.Songs.GetSearchFilter().Length > 0)
|
||||
{
|
||||
_CoverBig.Texture = _CoverBigTexture;
|
||||
_Artist.Text = String.Empty;
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||
<CodeAnalysisRuleSet>..\CheckingRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseWin|x64'">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@@ -110,6 +111,7 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="Menu\CBackground.cs" />
|
||||
<Compile Include="Menu\CBasic.cs" />
|
||||
<Compile Include="Menu\CButton.cs" />
|
||||
|
||||
Reference in new issue
Block a user