Exemplo n.º 1
0
        public IEnumerable <IUnit> GetRepeatableUnits(object ownerKey = null)
        {
            List <IUnit> result;

            if (ownerKey == null)
            {
                result = globallyRepeatableUnits.Where(unit => unit.Repeatable).Cast <IUnit>().ToList();
                return(result);
            }

            if (!repeatableDictionary.TryGetValue(ownerKey,
                                                  // ReSharper disable once CollectionNeverUpdated.Local
                                                  out UnitCollection <IInternalUnit> units))
            {
                return(new List <IUnit>());
            }
            result = units.Where(unit => unit.Repeatable).Cast <IUnit>().ToList();
            return(result);
        }