индексатор

This commit is contained in:
Мельников Игорь 2022-12-07 16:40:10 +04:00
parent 4da3dba800
commit 4d35cc62f5
2 changed files with 17 additions and 0 deletions

View File

@ -24,6 +24,10 @@
/// Набор объектов /// Набор объектов
/// </summary> /// </summary>
private readonly SetLocomotivesGeneric<T> _setLocomotives; private readonly SetLocomotivesGeneric<T> _setLocomotives;
public T GetObject(int index)
{
return _setLocomotives[index];
}
/// <summary> /// <summary>
/// Карта /// Карта
/// </summary> /// </summary>

View File

@ -68,6 +68,19 @@
return null; return null;
} }
} }
public IDrawningObject this[string dictIndex, int objIndex]
{
get
{
if (_mapStorages.ContainsKey(dictIndex))
{
var selectedDictElement = _mapStorages[dictIndex];
var selectedObject = selectedDictElement.GetObject(objIndex);
return selectedObject;
}
return null;
}
}
} }
} }