/// <summary> /// Adds the specified layer at a specified index /// </summary> /// <param name="layer">The layer to add</param> /// <param name="index">The index to add the layer at</param> public void AddLayer(IFrameLayer layer, int index = -1) { BeforeLayerCreated?.Invoke(this, new EventArgs()); _frame.AddLayer(layer, index); LayerCreated?.Invoke(this, new LayerControllerLayerCreatedEventArgs(layer)); }
/// <summary> /// Adds a layer with a specified bitmap at the specified index /// </summary> /// <param name="bitmap">The bitmap to use as a layer</param> /// <param name="index">The index to add the layer at</param> /// <returns>The layer that was created</returns> public IFrameLayer AddLayer(Bitmap bitmap, int index = -1) { BeforeLayerCreated?.Invoke(this, new EventArgs()); IFrameLayer layer = _frame.AddLayer(bitmap, index); LayerCreated?.Invoke(this, new LayerControllerLayerCreatedEventArgs(layer)); return(layer); }
/// <summary> /// Creates a layer at the specified index /// </summary> /// <param name="layerIndex">The index at which to create the layer</param> public IFrameLayer CreateLayer(int layerIndex = -1) { BeforeLayerCreated?.Invoke(this, new EventArgs()); IFrameLayer layer = _frame.CreateLayer(layerIndex); LayerCreated?.Invoke(this, new LayerControllerLayerCreatedEventArgs(layer)); return(layer); }
/// <summary> /// Create a new layer with first free name formatted as "New Layer {num}" /// </summary> public void CreateNewLayer(string layerName) { string newLayerName = layerName; if (string.IsNullOrEmpty(newLayerName)) { newLayerName = GetNewLayerValidName(); } if (ValidateNewLayerName(newLayerName)) { _layers.Add(newLayerName, new List <MonoBehaviour>()); RebuildTree(); LayerCreated?.Invoke(TreeRoot.Find(e => (e.Type == LayerTreeViewElementType.Layer && e.LayerName == newLayerName))); } }