示例#1
0
        public IEnumerable <IUnit> GetRedoableUnits(object ownerKey = null)
        {
            if (ownerKey == null)
            {
                return(new List <IUnit>(globallyRedoableUnits.Cast <IUnit>()));
            }

            if (!redoableDictionary.TryGetValue(ownerKey,
                                                // ReSharper disable once CollectionNeverUpdated.Local
                                                out UnitCollection <IUndoableUnit> units))
            {
                return(new List <IUnit>());
            }
            return(new List <IUnit>(units.Cast <IUnit>()));
        }