private void AddLayer(ImageEditorLayer layer, Panel parent) { if (layer != null && parent != null) { layer.Owner = this; layer.AttachUI(parent); } }
private void RemoveLayer(ImageEditorLayer layer, Panel parent) { if (layer != null && parent != null) { layer.DetachUI(parent); layer.Owner = null; } }
private void SelectLayer(ImageEditorTool tool) { this.RemoveLayer(this.toolLayer, this.imageHost); this.toolLayer = this.LayerSelector != null?this.LayerSelector.SelectLayer(tool) : null; this.AddLayer(this.toolLayer, this.imageHost); this.InvalidateArrange(); }