using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using bsmd.AIS2Service; namespace AISAdmin { public partial class EditAssignmentDialog : Form { public EditAssignmentDialog() { InitializeComponent(); } public MonitorAssignment Assignment { get; set; } private void EditAssignmentDialog_Load(object sender, EventArgs e) { comboBoxType.DataSource = Enum.GetValues(typeof(MonitorAssignment.ZoneMonitorType)); this.numericUpDownMMSI.Value = Assignment.MMSI; this.comboBoxType.SelectedItem = Assignment.MonitorType; } private void buttonOK_Click(object sender, EventArgs e) { this.Assignment.MMSI = (int) this.numericUpDownMMSI.Value; MonitorAssignment.ZoneMonitorType mType; Enum.TryParse(this.comboBoxType.SelectedValue.ToString(), out mType); this.Assignment.MonitorType = mType; } } }