private void OnEditLayerRight(object sender, EventArgs e)
 {
     try
     {
         // get content
         if (!(cbCases.SelectedType is Packable packable))
         {
             return;
         }
         // get container
         var      constraintSet = BuildConstraintSet();
         Vector2D layerDim      = new Vector2D(SelectedPallet.Length, SelectedPallet.Width) + 2 * constraintSet.Overhang;
         // get selected layer
         ILayer2D[] layers = uCtrlLayerListEdited.Selected;
         if (layers.Length != 1)
         {
             return;
         }
         Layer2DBrickExp layer = layers[0] as Layer2DBrickExp;
         using (var form = new FormEditLayer(layer, packable))
         {
             form.TopMost = true;
             if (DialogResult.OK == form.ShowDialog())
             {
                 _layersEdited.Remove(layer);
                 _layersEdited.Add(form.Layer);
                 FillEditedLayerList();
             }
         }
     }
     catch (Exception ex)
     {
         _log.Error(ex.ToString());
     }
 }
 private void OnEditLayer(object sender, EventArgs e)
 {
     try
     {
         if (!Program.IsSubscribed)
         {
             MessageBox.Show(Resources.ID_WARNINGEDITLAYER, Application.ProductName, MessageBoxButtons.OK);
         }
         // get content
         if (!(cbCases.SelectedType is Packable packable))
         {
             return;
         }
         // get container
         var      constraintSet = BuildConstraintSet();
         Vector2D layerDim      = new Vector2D(SelectedPallet.Length, SelectedPallet.Width) + 2 * constraintSet.Overhang;
         // get selected layer
         ILayer2D[] layers = uCtrlLayerList.Selected;
         if (layers.Length != 1)
         {
             return;
         }
         Layer2DBrickImp layer = layers[0] as Layer2DBrickImp;
         using (var form = new FormEditLayer(layer.GenerateLayer2DEdited(), packable))
         {
             form.TopMost = true;
             if (DialogResult.OK == form.ShowDialog())
             {
                 _layersEdited.Add(form.Layer);
                 FillEditedLayerList();
             }
         }
     }
     catch (Exception ex)
     {
         _log.Error(ex.ToString());
     }
 }