Fix some resharper warnings and errors
This commit is contained in:
1 parent
167202e8ff
commit
cd59b82b7b
35 files changed
+81
-173
No files matched your search
@@ -18,6 +18,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using VocaluxeLib.Game;
|
using VocaluxeLib.Game;
|
||||||
using VocaluxeLib.Menu;
|
using VocaluxeLib.Menu;
|
||||||
@@ -386,9 +387,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Calc avarage sing-count
|
//Calc avarage sing-count
|
||||||
int totalCounts = 0;
|
int totalCounts = visibleSongs.Sum(song => song.NumPlayedSession);
|
||||||
foreach (CSong song in visibleSongs)
|
|
||||||
totalCounts += song.NumPlayedSession;
|
|
||||||
int averageCount = totalCounts / visibleSongs.Count;
|
int averageCount = totalCounts / visibleSongs.Count;
|
||||||
|
|
||||||
// ReSharper disable LoopCanBeConvertedToQuery
|
// ReSharper disable LoopCanBeConvertedToQuery
|
||||||
|
|||||||
@@ -104,8 +104,9 @@ namespace ServerLib
|
|||||||
IPEndPoint groupEp = new IPEndPoint(IPAddress.Any, _Port);
|
IPEndPoint groupEp = new IPEndPoint(IPAddress.Any, _Port);
|
||||||
listener.Client.ReceiveTimeout = timeout;
|
listener.Client.ReceiveTimeout = timeout;
|
||||||
|
|
||||||
byte[] bytes = listener.Receive(ref groupEp);
|
//byte[] bytes =
|
||||||
string message = Encoding.UTF8.GetString(bytes, 0, bytes.Length);
|
listener.Receive(ref groupEp);
|
||||||
|
//string message = Encoding.UTF8.GetString(bytes, 0, bytes.Length);
|
||||||
|
|
||||||
foundSomething = true;
|
foundSomething = true;
|
||||||
if (!knownServer.Contains(groupEp.Address.ToString()))
|
if (!knownServer.Contains(groupEp.Address.ToString()))
|
||||||
|
|||||||
@@ -138,8 +138,7 @@ namespace ServerLib
|
|||||||
|
|
||||||
return CServer.GetProfileData(profileId, isReadonly);
|
return CServer.GetProfileData(profileId, isReadonly);
|
||||||
}
|
}
|
||||||
else
|
return new SProfileData();
|
||||||
return new SProfileData();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SProfileData[] GetProfileList()
|
public SProfileData[] GetProfileList()
|
||||||
|
|||||||
@@ -69,9 +69,10 @@ namespace ServerLib
|
|||||||
[DataContract]
|
[DataContract]
|
||||||
public class CBase64Image
|
public class CBase64Image
|
||||||
{
|
{
|
||||||
|
// ReSharper disable InconsistentNaming
|
||||||
[DataMember] private string base64Data = "";
|
[DataMember] private string base64Data = "";
|
||||||
|
|
||||||
[DataMember] private string imageId = "";
|
[DataMember] private string imageId = "";
|
||||||
|
// ReSharper restore InconsistentNaming
|
||||||
|
|
||||||
public CBase64Image(Image img, ImageFormat format)
|
public CBase64Image(Image img, ImageFormat format)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ namespace ServerLib
|
|||||||
[Flags]
|
[Flags]
|
||||||
enum EUserRoles
|
enum EUserRoles
|
||||||
{
|
{
|
||||||
|
// ReSharper disable InconsistentNaming
|
||||||
TR_USERROLE_GUEST = 0,
|
TR_USERROLE_GUEST = 0,
|
||||||
TR_USERROLE_NORMAL = 1,
|
TR_USERROLE_NORMAL = 1,
|
||||||
TR_USERROLE_ADMIN = 2,
|
TR_USERROLE_ADMIN = 2,
|
||||||
@@ -29,5 +30,6 @@ namespace ServerLib
|
|||||||
TR_USERROLE_ADDSONGSUSER = 8,
|
TR_USERROLE_ADDSONGSUSER = 8,
|
||||||
TR_USERROLE_PLAYLISTEDITOR = 16,
|
TR_USERROLE_PLAYLISTEDITOR = 16,
|
||||||
TR_USERROLE_PROFILEEDITOR = 32
|
TR_USERROLE_PROFILEEDITOR = 32
|
||||||
|
// ReSharper restore InconsistentNaming
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
<s:String x:Key="/Default/CodeEditing/GenerateMemberBody/MethodImplementationKind/@EntryValue">NotCompiledCode</s:String>
|
<s:String x:Key="/Default/CodeEditing/GenerateMemberBody/MethodImplementationKind/@EntryValue">NotCompiledCode</s:String>
|
||||||
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntelliSenseCompletingCharacters/IntelliSenseCompletingCharactersSettingCSharp/UpgradedFromVSSettings/@EntryValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntelliSenseCompletingCharacters/IntelliSenseCompletingCharactersSettingCSharp/UpgradedFromVSSettings/@EntryValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/LookupWindow/ShowSignatures/@EntryValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/LookupWindow/ShowSignatures/@EntryValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/ExcludedFiles/FileMasksToSkip/=_002A_002Ejs/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/AnalysisEnabled/@EntryValue">SOLUTION</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/AnalysisEnabled/@EntryValue">SOLUTION</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EmptyGeneralCatchClause/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EmptyGeneralCatchClause/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantExplicitArrayCreation/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantExplicitArrayCreation/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||||
|
|||||||
@@ -162,8 +162,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
_SongPlayer = new CSongPlayer();
|
_SongPlayer = new CSongPlayer();
|
||||||
|
|
||||||
_PreviewPlayer = new CSongPlayer();
|
_PreviewPlayer = new CSongPlayer {RepeatSong = true};
|
||||||
_PreviewPlayer.RepeatSong = true;
|
|
||||||
|
|
||||||
_VideoEnabled = (CConfig.Config.Video.VideoBackgrounds == EOffOn.TR_CONFIG_ON && CConfig.Config.Video.VideosToBackground == EOffOn.TR_CONFIG_ON);
|
_VideoEnabled = (CConfig.Config.Video.VideoBackgrounds == EOffOn.TR_CONFIG_ON && CConfig.Config.Video.VideosToBackground == EOffOn.TR_CONFIG_ON);
|
||||||
SetMusicSource(CConfig.Config.Sound.BackgroundMusicSource);
|
SetMusicSource(CConfig.Config.Sound.BackgroundMusicSource);
|
||||||
@@ -339,8 +338,10 @@ namespace Vocaluxe.Base
|
|||||||
if (song == null)
|
if (song == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// ReSharper disable CompareOfFloatsByEqualityOperator
|
||||||
if (start == 0f)
|
if (start == 0f)
|
||||||
start = song.Preview.StartTime;
|
start = song.Preview.StartTime;
|
||||||
|
// ReSharper restore CompareOfFloatsByEqualityOperator
|
||||||
|
|
||||||
_PlaysPreview = true;
|
_PlaysPreview = true;
|
||||||
CSound.SetGlobalVolume(CConfig.PreviewMusicVolume);
|
CSound.SetGlobalVolume(CConfig.PreviewMusicVolume);
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Vocaluxe.Screens;
|
|
||||||
using Vocaluxe.SongQueue;
|
using Vocaluxe.SongQueue;
|
||||||
using VocaluxeLib;
|
using VocaluxeLib;
|
||||||
using VocaluxeLib.Game;
|
using VocaluxeLib.Game;
|
||||||
|
|||||||
@@ -69,23 +69,20 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static void Pause()
|
public static void Pause()
|
||||||
{
|
{
|
||||||
if (_Webcam == null)
|
if (_Webcam != null)
|
||||||
return;
|
_Webcam.Pause();
|
||||||
_Webcam.Pause();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Start()
|
public static void Start()
|
||||||
{
|
{
|
||||||
if (_Webcam == null)
|
if (_Webcam != null)
|
||||||
return;
|
_Webcam.Start();
|
||||||
_Webcam.Start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Stop()
|
public static void Stop()
|
||||||
{
|
{
|
||||||
if (_Webcam == null)
|
if (_Webcam != null)
|
||||||
return;
|
_Webcam.Stop();
|
||||||
_Webcam.Stop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool Select(SWebcamConfig c)
|
public static bool Select(SWebcamConfig c)
|
||||||
@@ -95,9 +92,8 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static void DeSelect()
|
public static void DeSelect()
|
||||||
{
|
{
|
||||||
if (_Webcam == null)
|
if (_Webcam != null)
|
||||||
return;
|
_Webcam.DeSelect();
|
||||||
_Webcam.DeSelect();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SWebcamDevice[] GetDevices()
|
public static SWebcamDevice[] GetDevices()
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ namespace Vocaluxe.Base.Server
|
|||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
foreach (char key in keyString.ToCharArray())
|
foreach (char key in keyString)
|
||||||
{
|
{
|
||||||
Controller.AddKeyEvent(new SKeyEvent(ESender.Keyboard, isAltPressed,
|
Controller.AddKeyEvent(new SKeyEvent(ESender.Keyboard, isAltPressed,
|
||||||
Char.IsUpper(key) || isShiftPressed,
|
Char.IsUpper(key) || isShiftPressed,
|
||||||
@@ -695,10 +695,14 @@ namespace Vocaluxe.Base.Server
|
|||||||
IEnumerable<int> playerIds = (from p in CProfiles.GetProfiles()
|
IEnumerable<int> playerIds = (from p in CProfiles.GetProfiles()
|
||||||
where String.Equals(p.PlayerName, username, StringComparison.OrdinalIgnoreCase)
|
where String.Equals(p.PlayerName, username, StringComparison.OrdinalIgnoreCase)
|
||||||
select p.ID);
|
select p.ID);
|
||||||
if (!playerIds.Any())
|
try
|
||||||
|
{
|
||||||
|
return playerIds.First();
|
||||||
|
}
|
||||||
|
catch (InvalidOperationException)
|
||||||
|
{
|
||||||
throw new ArgumentException("Invalid playername");
|
throw new ArgumentException("Invalid playername");
|
||||||
|
}
|
||||||
return playerIds.First();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static byte[] _Hash(byte[] password, byte[] salt)
|
private static byte[] _Hash(byte[] password, byte[] salt)
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Vocaluxe
|
namespace Vocaluxe
|
||||||
@@ -24,29 +23,14 @@ namespace Vocaluxe
|
|||||||
static class COSFunctions
|
static class COSFunctions
|
||||||
{
|
{
|
||||||
#if WIN
|
#if WIN
|
||||||
private static bool _DefaultDllDirSet;
|
|
||||||
private static bool _UsePath;
|
|
||||||
private static bool _UseSetDllDir;
|
|
||||||
|
|
||||||
private static class CWindowsFunctions
|
private static class CWindowsFunctions
|
||||||
{
|
{
|
||||||
[DllImport("kernel32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
|
// ReSharper disable MemberHidesStaticFromOuterClass
|
||||||
public static extern void AddDllDirectory(string lpPathName);
|
|
||||||
|
|
||||||
[DllImport("kernel32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
|
|
||||||
public static extern void SetDllDirectory(string lpPathName);
|
|
||||||
|
|
||||||
[DllImport("user32.dll", CallingConvention = CallingConvention.StdCall)]
|
[DllImport("user32.dll", CallingConvention = CallingConvention.StdCall)]
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
public static extern bool SetForegroundWindow(IntPtr hWnd);
|
public static extern bool SetForegroundWindow(IntPtr hWnd);
|
||||||
|
|
||||||
[DllImport("kernel32.dll", CallingConvention = CallingConvention.StdCall)]
|
// ReSharper restore MemberHidesStaticFromOuterClass
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
|
||||||
public static extern bool SetDefaultDllDirectories(int directoryFlags);
|
|
||||||
|
|
||||||
// ReSharper disable InconsistentNaming
|
|
||||||
public const int LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000;
|
|
||||||
// ReSharper restore InconsistentNaming
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ namespace Vocaluxe.Lib.Webcam
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the last captured frame as a bitma
|
/// Gets the last captured frame as a bitma
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="frame"></param>
|
|
||||||
/// <returns>Null if no frame was captured, the bitmap otherwise</returns>
|
/// <returns>Null if no frame was captured, the bitmap otherwise</returns>
|
||||||
Bitmap GetBitmap();
|
Bitmap GetBitmap();
|
||||||
|
|
||||||
|
|||||||
@@ -257,8 +257,8 @@ namespace Vocaluxe.Screens
|
|||||||
_Config.Height = d.Capabilities[_CapabilityNr].Height;
|
_Config.Height = d.Capabilities[_CapabilityNr].Height;
|
||||||
_Config.Framerate = d.Capabilities[_CapabilityNr].Framerate;
|
_Config.Framerate = d.Capabilities[_CapabilityNr].Framerate;
|
||||||
|
|
||||||
CWebcam.Select(_Config);
|
if (CWebcam.Select(_Config))
|
||||||
CWebcam.Start();
|
CWebcam.Start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,9 +27,11 @@ namespace VocaluxeLib
|
|||||||
|
|
||||||
public struct SThemeFont
|
public struct SThemeFont
|
||||||
{
|
{
|
||||||
|
// ReSharper disable UnassignedField.Global
|
||||||
public string Name;
|
public string Name;
|
||||||
public EStyle Style;
|
public EStyle Style;
|
||||||
public float Size;
|
public float Size;
|
||||||
|
// ReSharper restore UnassignedField.Global
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CFont
|
public class CFont
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ namespace VocaluxeLib.Menu
|
|||||||
_PartyModeID = partyModeID;
|
_PartyModeID = partyModeID;
|
||||||
|
|
||||||
ThemeLoaded = true;
|
ThemeLoaded = true;
|
||||||
LoadSkin();
|
|
||||||
}
|
}
|
||||||
#endregion Constructors
|
#endregion Constructors
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,6 @@ namespace VocaluxeLib.Menu
|
|||||||
EditMode = false;
|
EditMode = false;
|
||||||
|
|
||||||
ThemeLoaded = true;
|
ThemeLoaded = true;
|
||||||
LoadSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CButton(CButton button)
|
public CButton(CButton button)
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ namespace VocaluxeLib.Menu
|
|||||||
_Theme = theme;
|
_Theme = theme;
|
||||||
|
|
||||||
ThemeLoaded = true;
|
ThemeLoaded = true;
|
||||||
LoadSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool LoadTheme(string xmlPath, string elementName, CXmlReader xmlReader)
|
public bool LoadTheme(string xmlPath, string elementName, CXmlReader xmlReader)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace VocaluxeLib.Menu
|
|||||||
ParticleEffect
|
ParticleEffect
|
||||||
}
|
}
|
||||||
|
|
||||||
class CInteraction
|
public class CInteraction
|
||||||
{
|
{
|
||||||
public readonly int Num;
|
public readonly int Num;
|
||||||
public readonly EType Type;
|
public readonly EType Type;
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ namespace VocaluxeLib.Menu
|
|||||||
LyricStyle = ELyricStyle.Fill;
|
LyricStyle = ELyricStyle.Fill;
|
||||||
|
|
||||||
ThemeLoaded = true;
|
ThemeLoaded = true;
|
||||||
LoadSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool LoadTheme(string xmlPath, string elementName, CXmlReader xmlReader)
|
public bool LoadTheme(string xmlPath, string elementName, CXmlReader xmlReader)
|
||||||
|
|||||||
+20
-83
@@ -201,13 +201,27 @@ namespace VocaluxeLib.Menu
|
|||||||
_AddSingNote(new CSingNotes(sb, PartyModeID), sb.Name);
|
_AddSingNote(new CSingNotes(sb, PartyModeID), sb.Name);
|
||||||
|
|
||||||
foreach (SThemeSongMenu sm in Theme.SongMenus)
|
foreach (SThemeSongMenu sm in Theme.SongMenus)
|
||||||
_AddSongMenu(CSongMenuFactory.GetSongMenu(sm, PartyModeID), sm.Name);
|
_AddSongMenu(CSongMenuFactory.CreateSongMenu(sm, PartyModeID), sm.Name);
|
||||||
|
|
||||||
foreach (SThemeStatic st in Theme.Statics)
|
foreach (SThemeStatic st in Theme.Statics)
|
||||||
_AddStatic(new CStatic(st, PartyModeID), st.Name);
|
_AddStatic(new CStatic(st, PartyModeID), st.Name);
|
||||||
|
|
||||||
foreach (SThemeText te in Theme.Texts)
|
foreach (SThemeText te in Theme.Texts)
|
||||||
_AddText(new CText(te, PartyModeID), te.Name);
|
_AddText(new CText(te, PartyModeID), te.Name);
|
||||||
|
|
||||||
|
if (_ScreenVersion != Theme.Informations.ScreenVersion)
|
||||||
|
{
|
||||||
|
string msg = "Can't load screen file of screen \"" + ThemeName + "\", ";
|
||||||
|
if (Theme.Informations.ScreenVersion < _ScreenVersion)
|
||||||
|
msg += "the file ist outdated! ";
|
||||||
|
else
|
||||||
|
msg += "the file is for newer program versions! ";
|
||||||
|
|
||||||
|
msg += "Current screen version is " + _ScreenVersion;
|
||||||
|
CBase.Log.LogError(msg);
|
||||||
|
}
|
||||||
|
foreach (IThemeable el in _Elements.Select(_GetElement).OfType<IThemeable>())
|
||||||
|
el.LoadSkin();
|
||||||
}
|
}
|
||||||
catch (InvalidOperationException)
|
catch (InvalidOperationException)
|
||||||
{
|
{
|
||||||
@@ -217,17 +231,6 @@ namespace VocaluxeLib.Menu
|
|||||||
{
|
{
|
||||||
CBase.Log.LogError(e.Message + e.StackTrace, true, true);
|
CBase.Log.LogError(e.Message + e.StackTrace, true, true);
|
||||||
}
|
}
|
||||||
if (_ScreenVersion != Theme.Informations.ScreenVersion)
|
|
||||||
{
|
|
||||||
string msg = "Can't load screen file of screen \"" + ThemeName + "\", ";
|
|
||||||
if (Theme.Informations.ScreenVersion < _ScreenVersion)
|
|
||||||
msg += "the file ist outdated! ";
|
|
||||||
else
|
|
||||||
msg += "the file is for newer program versions! ";
|
|
||||||
|
|
||||||
msg += "Current screen version is " + _ScreenVersion;
|
|
||||||
CBase.Log.LogError(msg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void _AddScreenSetting(CScreenSetting screenSetting, string name)
|
private void _AddScreenSetting(CScreenSetting screenSetting, string name)
|
||||||
@@ -257,7 +260,7 @@ namespace VocaluxeLib.Menu
|
|||||||
_LoadThemeElement<CSelectSlide>(_ThemeSelectSlides, _AddSelectSlide, xmlReader);
|
_LoadThemeElement<CSelectSlide>(_ThemeSelectSlides, _AddSelectSlide, xmlReader);
|
||||||
foreach (string elName in _ThemeSongMenus)
|
foreach (string elName in _ThemeSongMenus)
|
||||||
{
|
{
|
||||||
ISongMenu element = CSongMenuFactory.GetSongMenu(PartyModeID);
|
ISongMenu element = CSongMenuFactory.CreateSongMenu(PartyModeID);
|
||||||
if (element.LoadTheme("//root/" + ThemeName, elName, xmlReader))
|
if (element.LoadTheme("//root/" + ThemeName, elName, xmlReader))
|
||||||
_AddSongMenu(element, elName);
|
_AddSongMenu(element, elName);
|
||||||
else
|
else
|
||||||
@@ -338,80 +341,14 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
public virtual void ReloadSkin()
|
public virtual void ReloadSkin()
|
||||||
{
|
{
|
||||||
foreach (CBackground background in _Backgrounds)
|
foreach (IThemeable el in _Elements.Select(_GetElement).OfType<IThemeable>())
|
||||||
background.ReloadSkin();
|
el.ReloadSkin();
|
||||||
|
|
||||||
foreach (CButton button in _Buttons)
|
|
||||||
button.ReloadSkin();
|
|
||||||
|
|
||||||
foreach (CText text in _Texts)
|
|
||||||
text.ReloadSkin();
|
|
||||||
|
|
||||||
foreach (CStatic stat in _Statics)
|
|
||||||
stat.ReloadSkin();
|
|
||||||
|
|
||||||
foreach (CSelectSlide slide in _SelectSlides)
|
|
||||||
slide.ReloadSkin();
|
|
||||||
|
|
||||||
foreach (CSongMenuFramework sm in _SongMenus)
|
|
||||||
sm.ReloadSkin();
|
|
||||||
|
|
||||||
foreach (CLyric lyric in _Lyrics)
|
|
||||||
lyric.ReloadSkin();
|
|
||||||
|
|
||||||
foreach (CSingNotes sn in _SingNotes)
|
|
||||||
sn.ReloadSkin();
|
|
||||||
|
|
||||||
foreach (CNameSelection ns in _NameSelections)
|
|
||||||
ns.ReloadSkin();
|
|
||||||
|
|
||||||
foreach (CEqualizer eq in _Equalizers)
|
|
||||||
eq.ReloadSkin();
|
|
||||||
|
|
||||||
foreach (CPlaylist pls in _Playlists)
|
|
||||||
pls.ReloadSkin();
|
|
||||||
|
|
||||||
foreach (CParticleEffect pe in _ParticleEffects)
|
|
||||||
pe.ReloadSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void UnloadSkin()
|
public virtual void UnloadSkin()
|
||||||
{
|
{
|
||||||
foreach (CBackground background in _Backgrounds)
|
foreach (IThemeable el in _Elements.Select(_GetElement).OfType<IThemeable>())
|
||||||
background.UnloadSkin();
|
el.UnloadSkin();
|
||||||
|
|
||||||
foreach (CButton button in _Buttons)
|
|
||||||
button.UnloadSkin();
|
|
||||||
|
|
||||||
foreach (CText text in _Texts)
|
|
||||||
text.UnloadSkin();
|
|
||||||
|
|
||||||
foreach (CStatic stat in _Statics)
|
|
||||||
stat.UnloadSkin();
|
|
||||||
|
|
||||||
foreach (CSelectSlide slide in _SelectSlides)
|
|
||||||
slide.UnloadSkin();
|
|
||||||
|
|
||||||
foreach (CSongMenuFramework sm in _SongMenus)
|
|
||||||
sm.UnloadSkin();
|
|
||||||
|
|
||||||
foreach (CLyric lyric in _Lyrics)
|
|
||||||
lyric.UnloadSkin();
|
|
||||||
|
|
||||||
foreach (CSingNotes sn in _SingNotes)
|
|
||||||
sn.UnloadSkin();
|
|
||||||
|
|
||||||
foreach (CNameSelection ns in _NameSelections)
|
|
||||||
ns.UnloadSkin();
|
|
||||||
|
|
||||||
foreach (CPlaylist pls in _Playlists)
|
|
||||||
pls.UnloadSkin();
|
|
||||||
|
|
||||||
foreach (CEqualizer eq in _Equalizers)
|
|
||||||
eq.UnloadSkin();
|
|
||||||
|
|
||||||
foreach (CParticleEffect pe in _ParticleEffects)
|
|
||||||
pe.UnloadSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void ReloadTheme(string xmlPath)
|
public virtual void ReloadTheme(string xmlPath)
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System;
|
|
||||||
using VocaluxeLib.PartyModes;
|
using VocaluxeLib.PartyModes;
|
||||||
|
|
||||||
namespace VocaluxeLib.Menu
|
namespace VocaluxeLib.Menu
|
||||||
|
|||||||
@@ -136,7 +136,6 @@ namespace VocaluxeLib.Menu
|
|||||||
_UsedProfiles = new List<int>();
|
_UsedProfiles = new List<int>();
|
||||||
|
|
||||||
ThemeLoaded = true;
|
ThemeLoaded = true;
|
||||||
LoadSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Init()
|
public void Init()
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace VocaluxeLib.Menu
|
|||||||
{
|
{
|
||||||
public abstract class CObjectInteractions
|
public abstract class CObjectInteractions
|
||||||
{
|
{
|
||||||
private readonly List<CInteraction> _Elements = new List<CInteraction>();
|
protected readonly List<CInteraction> _Elements = new List<CInteraction>();
|
||||||
private int _Selection;
|
private int _Selection;
|
||||||
|
|
||||||
private Point _PrevMouse;
|
private Point _PrevMouse;
|
||||||
@@ -245,7 +245,7 @@ namespace VocaluxeLib.Menu
|
|||||||
return _Selection >= 0 && _Selection < _Elements.Count;
|
return _Selection >= 0 && _Selection < _Elements.Count;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IMenuElement _GetElement(CInteraction element)
|
protected IMenuElement _GetElement(CInteraction element)
|
||||||
{
|
{
|
||||||
switch (element.Type)
|
switch (element.Type)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -125,7 +125,6 @@ namespace VocaluxeLib.Menu
|
|||||||
Visible = true;
|
Visible = true;
|
||||||
|
|
||||||
ThemeLoaded = true;
|
ThemeLoaded = true;
|
||||||
LoadSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool LoadTheme(string xmlPath, string elementName, CXmlReader xmlReader)
|
public bool LoadTheme(string xmlPath, string elementName, CXmlReader xmlReader)
|
||||||
|
|||||||
@@ -253,14 +253,6 @@ namespace VocaluxeLib.Menu
|
|||||||
_ButtonPlaylistSing = new CButton(_Theme.ButtonPlaylistSing, _PartyModeID);
|
_ButtonPlaylistSing = new CButton(_Theme.ButtonPlaylistSing, _PartyModeID);
|
||||||
_SelectSlideGameMode = new CSelectSlide(_Theme.SelectSlideGameMode, _PartyModeID);
|
_SelectSlideGameMode = new CSelectSlide(_Theme.SelectSlideGameMode, _PartyModeID);
|
||||||
|
|
||||||
Visible = false;
|
|
||||||
Selected = false;
|
|
||||||
ThemeLoaded = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Init()
|
|
||||||
{
|
|
||||||
base.Init();
|
|
||||||
_AddStatic(_StaticPlaylistFooter);
|
_AddStatic(_StaticPlaylistFooter);
|
||||||
_AddStatic(_StaticPlaylistHeader);
|
_AddStatic(_StaticPlaylistHeader);
|
||||||
_AddButton(_ButtonPlaylistName);
|
_AddButton(_ButtonPlaylistName);
|
||||||
@@ -268,7 +260,10 @@ namespace VocaluxeLib.Menu
|
|||||||
_AddButton(_ButtonPlaylistDelete);
|
_AddButton(_ButtonPlaylistDelete);
|
||||||
_AddButton(_ButtonPlaylistSave);
|
_AddButton(_ButtonPlaylistSave);
|
||||||
_AddButton(_ButtonPlaylistSing);
|
_AddButton(_ButtonPlaylistSing);
|
||||||
LoadSkin();
|
|
||||||
|
Visible = false;
|
||||||
|
Selected = false;
|
||||||
|
ThemeLoaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool LoadTheme(string xmlPath, string elementName, CXmlReader xmlReader)
|
public bool LoadTheme(string xmlPath, string elementName, CXmlReader xmlReader)
|
||||||
@@ -886,11 +881,13 @@ namespace VocaluxeLib.Menu
|
|||||||
if (_ChangeOrderSource >= _PlaylistElementContents.Count)
|
if (_ChangeOrderSource >= _PlaylistElementContents.Count)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
_ChangeOrderElement = new CPlaylistElement(_PlaylistElements[_CurrentPlaylistElement]);
|
_ChangeOrderElement = new CPlaylistElement(_PlaylistElements[_CurrentPlaylistElement])
|
||||||
_ChangeOrderElement.Background.Z = CBase.Settings.GetZNear();
|
{
|
||||||
_ChangeOrderElement.Cover.Z = CBase.Settings.GetZNear();
|
Background = {Z = CBase.Settings.GetZNear()},
|
||||||
_ChangeOrderElement.SelectSlide.Z = CBase.Settings.GetZNear();
|
Cover = {Z = CBase.Settings.GetZNear()},
|
||||||
_ChangeOrderElement.Text1.Z = CBase.Settings.GetZNear();
|
SelectSlide = {Z = CBase.Settings.GetZNear()},
|
||||||
|
Text1 = {Z = CBase.Settings.GetZNear()}
|
||||||
|
};
|
||||||
|
|
||||||
_ChangeOrderElement.Background.Texture = CBase.Themes.GetSkinTexture(_Theme.SkinBackground, _PartyModeID);
|
_ChangeOrderElement.Background.Texture = CBase.Themes.GetSkinTexture(_Theme.SkinBackground, _PartyModeID);
|
||||||
_ChangeOrderElement.Background.Color = _BackgroundColor;
|
_ChangeOrderElement.Background.Color = _BackgroundColor;
|
||||||
|
|||||||
@@ -264,7 +264,6 @@ namespace VocaluxeLib.Menu
|
|||||||
_ValuePartyModeIDs = new List<int>();
|
_ValuePartyModeIDs = new List<int>();
|
||||||
|
|
||||||
ThemeLoaded = true;
|
ThemeLoaded = true;
|
||||||
LoadSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool LoadTheme(string xmlPath, string elementName, CXmlReader xmlReader)
|
public bool LoadTheme(string xmlPath, string elementName, CXmlReader xmlReader)
|
||||||
|
|||||||
@@ -111,8 +111,6 @@ namespace VocaluxeLib.Menu
|
|||||||
_PartyModeID = partyModeID;
|
_PartyModeID = partyModeID;
|
||||||
_Theme = theme;
|
_Theme = theme;
|
||||||
ThemeLoaded = true;
|
ThemeLoaded = true;
|
||||||
|
|
||||||
LoadSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool LoadTheme(string xmlPath, string elementName, CXmlReader xmlReader)
|
public bool LoadTheme(string xmlPath, string elementName, CXmlReader xmlReader)
|
||||||
|
|||||||
@@ -292,7 +292,6 @@ namespace VocaluxeLib.Menu
|
|||||||
_ButtonText = buttonText;
|
_ButtonText = buttonText;
|
||||||
|
|
||||||
ThemeLoaded = true;
|
ThemeLoaded = true;
|
||||||
LoadSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool LoadTheme(string xmlPath, string elementName, CXmlReader xmlReader)
|
public bool LoadTheme(string xmlPath, string elementName, CXmlReader xmlReader)
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ namespace VocaluxeLib.Menu.SingNotes
|
|||||||
_BarPos = new SRectF[CBase.Settings.GetMaxNumPlayer(),CBase.Settings.GetMaxNumPlayer()];
|
_BarPos = new SRectF[CBase.Settings.GetMaxNumPlayer(),CBase.Settings.GetMaxNumPlayer()];
|
||||||
|
|
||||||
ThemeLoaded = true;
|
ThemeLoaded = true;
|
||||||
LoadSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetThemeName()
|
public string GetThemeName()
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
{
|
{
|
||||||
public static class CSongMenuFactory
|
public static class CSongMenuFactory
|
||||||
{
|
{
|
||||||
public static ISongMenu GetSongMenu(SThemeSongMenu theme, int partyModeID)
|
public static ISongMenu CreateSongMenu(SThemeSongMenu theme, int partyModeID)
|
||||||
{
|
{
|
||||||
switch (CBase.Config.GetSongMenuType())
|
switch (CBase.Config.GetSongMenuType())
|
||||||
{
|
{
|
||||||
@@ -47,7 +47,7 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="partyModeID"></param>
|
/// <param name="partyModeID"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static ISongMenu GetSongMenu(int partyModeID)
|
public static ISongMenu CreateSongMenu(int partyModeID)
|
||||||
{
|
{
|
||||||
switch (CBase.Config.GetSongMenuType())
|
switch (CBase.Config.GetSongMenuType())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -157,7 +157,6 @@ namespace VocaluxeLib.Menu.SongMenu
|
|||||||
_Theme = theme;
|
_Theme = theme;
|
||||||
|
|
||||||
ThemeLoaded = true;
|
ThemeLoaded = true;
|
||||||
LoadSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Theme
|
#region Theme
|
||||||
|
|||||||
@@ -416,7 +416,9 @@ namespace VocaluxeLib.Songs
|
|||||||
{
|
{
|
||||||
//PreviewStart is not set or <=0
|
//PreviewStart is not set or <=0
|
||||||
_Song.Preview.StartTime = (headerFlags & EHeaderFlags.MedleyStartBeat) != 0 ? CBase.Game.GetTimeFromBeats(_Song.Medley.StartBeat, _Song.BPM) : 0f;
|
_Song.Preview.StartTime = (headerFlags & EHeaderFlags.MedleyStartBeat) != 0 ? CBase.Game.GetTimeFromBeats(_Song.Medley.StartBeat, _Song.BPM) : 0f;
|
||||||
|
// ReSharper disable CompareOfFloatsByEqualityOperator
|
||||||
_Song.Preview.Source = _Song.Preview.StartTime == 0 ? EDataSource.None : EDataSource.Calculated;
|
_Song.Preview.Source = _Song.Preview.StartTime == 0 ? EDataSource.None : EDataSource.Calculated;
|
||||||
|
// ReSharper restore CompareOfFloatsByEqualityOperator
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((headerFlags & EHeaderFlags.MedleyStartBeat) != 0 && (headerFlags & EHeaderFlags.MedleyEndBeat) != 0)
|
if ((headerFlags & EHeaderFlags.MedleyStartBeat) != 0 && (headerFlags & EHeaderFlags.MedleyEndBeat) != 0)
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// Allgemeine Informationen über eine Assembly werden über folgende
|
// Allgemeine Informationen über eine Assembly werden über folgende
|
||||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||||
// die einer Assembly zugeordnet sind.
|
// die einer Assembly zugeordnet sind.
|
||||||
|
|
||||||
[assembly: AssemblyTitle("VocaluxeTests")]
|
[assembly: AssemblyTitle("VocaluxeTests")]
|
||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
@@ -17,9 +17,11 @@ using System.Runtime.InteropServices;
|
|||||||
// Wenn ComVisible auf "false" festgelegt wird, sind die Typen innerhalb dieser Assembly
|
// Wenn ComVisible auf "false" festgelegt wird, sind die Typen innerhalb dieser Assembly
|
||||||
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
||||||
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
|
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
|
||||||
|
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||||
|
|
||||||
[assembly: Guid("3bdc6da5-a651-452e-903c-deec310288ad")]
|
[assembly: Guid("3bdc6da5-a651-452e-903c-deec310288ad")]
|
||||||
|
|
||||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||||
@@ -32,5 +34,6 @@ using System.Runtime.InteropServices;
|
|||||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||||
// durch Einsatz von '*', wie in nachfolgendem Beispiel:
|
// durch Einsatz von '*', wie in nachfolgendem Beispiel:
|
||||||
// [Assembly: AssemblyVersion("1.0.*")]
|
// [Assembly: AssemblyVersion("1.0.*")]
|
||||||
|
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
@@ -498,8 +498,7 @@ namespace WebserverInitalConfig
|
|||||||
{
|
{
|
||||||
if (String.IsNullOrEmpty(networkURL))
|
if (String.IsNullOrEmpty(networkURL))
|
||||||
throw new ArgumentNullException("networkURL");
|
throw new ArgumentNullException("networkURL");
|
||||||
HTTP_SERVICE_CONFIG_URLACL_SET res = new HTTP_SERVICE_CONFIG_URLACL_SET();
|
HTTP_SERVICE_CONFIG_URLACL_SET res = new HTTP_SERVICE_CONFIG_URLACL_SET {KeyDesc = new HTTP_SERVICE_CONFIG_URLACL_KEY("")};
|
||||||
res.KeyDesc = new HTTP_SERVICE_CONFIG_URLACL_KEY("");
|
|
||||||
CallHttpApi(
|
CallHttpApi(
|
||||||
delegate
|
delegate
|
||||||
{
|
{
|
||||||
@@ -539,9 +538,7 @@ namespace WebserverInitalConfig
|
|||||||
ThrowWin32ExceptionIfError(retVal);
|
ThrowWin32ExceptionIfError(retVal);
|
||||||
res = (HTTP_SERVICE_CONFIG_URLACL_SET)Marshal.PtrToStructure(pOutputConfigInfo, typeof(HTTP_SERVICE_CONFIG_URLACL_SET));
|
res = (HTTP_SERVICE_CONFIG_URLACL_SET)Marshal.PtrToStructure(pOutputConfigInfo, typeof(HTTP_SERVICE_CONFIG_URLACL_SET));
|
||||||
}
|
}
|
||||||
else if (ERROR_FILE_NOT_FOUND == retVal)
|
else if (ERROR_FILE_NOT_FOUND != retVal)
|
||||||
return;
|
|
||||||
else
|
|
||||||
ThrowWin32ExceptionIfError(retVal);
|
ThrowWin32ExceptionIfError(retVal);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
@@ -604,9 +601,7 @@ namespace WebserverInitalConfig
|
|||||||
HTTP_SERVICE_CONFIG_URLACL_KEY keyDesc = new HTTP_SERVICE_CONFIG_URLACL_KEY(networkURL);
|
HTTP_SERVICE_CONFIG_URLACL_KEY keyDesc = new HTTP_SERVICE_CONFIG_URLACL_KEY(networkURL);
|
||||||
HTTP_SERVICE_CONFIG_URLACL_PARAM paramDesc = new HTTP_SERVICE_CONFIG_URLACL_PARAM(securityDescriptor);
|
HTTP_SERVICE_CONFIG_URLACL_PARAM paramDesc = new HTTP_SERVICE_CONFIG_URLACL_PARAM(securityDescriptor);
|
||||||
|
|
||||||
HTTP_SERVICE_CONFIG_URLACL_SET inputConfigInfoSet = new HTTP_SERVICE_CONFIG_URLACL_SET();
|
HTTP_SERVICE_CONFIG_URLACL_SET inputConfigInfoSet = new HTTP_SERVICE_CONFIG_URLACL_SET {KeyDesc = keyDesc, ParamDesc = paramDesc};
|
||||||
inputConfigInfoSet.KeyDesc = keyDesc;
|
|
||||||
inputConfigInfoSet.ParamDesc = paramDesc;
|
|
||||||
|
|
||||||
IntPtr pInputConfigInfo = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(HTTP_SERVICE_CONFIG_URLACL_SET)));
|
IntPtr pInputConfigInfo = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(HTTP_SERVICE_CONFIG_URLACL_SET)));
|
||||||
Marshal.StructureToPtr(inputConfigInfoSet, pInputConfigInfo, false);
|
Marshal.StructureToPtr(inputConfigInfoSet, pInputConfigInfo, false);
|
||||||
|
|||||||
Reference in new issue
Block a user