Unify object interactions

This commit is contained in:
Flamefire committed 2014-10-18 18:46:13 +02:00
1 parent d8cce13211
commit b07d31f697
31 files changed
+1046 -2215

No files matched your search

+6 -4
View File
@@ -25,13 +25,15 @@ namespace VocaluxeLib.Menu
{
private readonly List<T> _Items;
private readonly Dictionary<String, int> _HtIndex;
private readonly CMenu _Parent;
private readonly String _ParentName;
public COrderedDictionaryLite(CMenu parent)
public COrderedDictionaryLite(object parent)
{
_Items = new List<T>();
_HtIndex = new Dictionary<String, int>();
_Parent = parent;
_ParentName = parent.GetType().Name;
if (_ParentName[0] == 'C' && Char.IsUpper(_ParentName[1]))
_ParentName = _ParentName.Remove(0, 1);
}
public T this[int index]
@@ -50,7 +52,7 @@ namespace VocaluxeLib.Menu
}
catch (Exception)
{
CBase.Log.LogError("Can't find " + typeof(T).Name.Substring(1) + " Element \"" + key + "\" in Screen " + _Parent.ThemeName);
CBase.Log.LogError("Can't find " + typeof(T).Name.Substring(1) + " Element \"" + key + "\" in " + _ParentName);
throw;
}
}