public void Edit()
        {
            var nsv   = GetView() as NetworkSelectionView;
            int index = nsv.NetworkList.SelectedIndex;

            if (index == -1)
            {
                return;
            }
            Network n = (Network)nsv.NetworkList.SelectedItem;

            index = this.networks.IndexOf(n);
            NetworkEditViewModel nevm = new NetworkEditViewModel(this.Networks[index].ShallowCopy());

            if (this.windowManager.ShowDialog(nevm) == true)
            {
                this.Networks.RemoveAt(index);
                this.Networks.Insert(index, nevm.Network);
                this.saveNetworks();
            }
        }
        public void Edit()
        {
            var nsv = GetView() as NetworkSelectionView;
              int index = nsv.NetworkList.SelectedIndex;
              if (index == -1)
              {
            return;
              }
              Network n = (Network)nsv.NetworkList.SelectedItem;
              index = this.networks.IndexOf(n);
              NetworkEditViewModel nevm = new NetworkEditViewModel(this.Networks[index].ShallowCopy());

              if (this.windowManager.ShowDialog(nevm) == true)
              {
            this.Networks.RemoveAt(index);
            this.Networks.Insert(index, nevm.Network);
            this.saveNetworks();
              }
        }