public override void Execute() { foreach (ObjectInstance inst in _objects) { _objectSource.AddObject(inst); } }
private ObjectLayer ProcessObjectLayer(ObjectLayer layer, ObjectPool objectLayerPool) { ObjectLayer outLayer = new ObjectLayer(layer.Name, layer.LayerOriginX, layer.LayerOriginY, layer.LayerWidth, layer.LayerHeight) { IsVisible = layer.IsVisible, Opacity = layer.Opacity, RasterMode = layer.RasterMode, }; foreach (Property prop in layer.PropertyManager.CustomProperties) { outLayer.PropertyManager.CustomProperties.Add(prop); } foreach (ObjectInstance obj in layer.Objects) { if (!objectLayerPool.Objects.Contains(obj.ObjectClass.Uid)) { objectLayerPool.Objects.Add(obj.ObjectClass); } outLayer.AddObject(obj); } return(outLayer); }
public override void Undo() { foreach (ObjectInstance inst in _objects) { _objectSource.AddObject(inst); } AddSelectedObjects(_objects); }