private void Add() { using (LayerDialog dialog = new LayerDialog() { Layer = (Layer)TemplateLayer.Clone() }) { if (dialog.ShowDialog(this) == DialogResult.OK) { Network.Add(dialog.Layer); UpdateItems(); } } }
private void Edit(int index) { Layer layer = Network[index]; using (LayerDialog dialog = new LayerDialog() { Layer = layer.Clone() as Layer }) { if (dialog.ShowDialog(this) == DialogResult.OK) { Network[index] = dialog.Layer; UpdateItems(); } } }