/// <summary> /// new location /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonNew_Click(object sender, EventArgs e) { EditLocationPanel d = new EditLocationPanel(); d.setLocation(null); d.PrefferedCountry = m_wndCountry.SelectedItem; d.OnEditLocationDone += new TBButtonPressed(OnEditLocationDone); EditLocationPanelController dc = new EditLocationPanelController(d); dc.ViewContainer = Controller.ViewContainer; Controller.ViewContainer.AddControl(dc, GVControlAlign.Center); }
/// <summary> /// edit location /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonEdit_Click(object sender, EventArgs e) { if (listViewLocations.SelectedItems.Count == 0) { return; } TLocation loc = listViewLocations.SelectedItems[0].Tag as TLocation; EditLocationPanel d = new EditLocationPanel(); d.setLocation(loc); d.PrefferedCountry = m_wndCountry.SelectedItem; d.OnEditLocationDone += new TBButtonPressed(OnEditLocationDone); EditLocationPanelController dc = new EditLocationPanelController(d); dc.ShowInContainer(Controller.ViewContainer, GVControlAlign.Center); }