public void UpdateModel <T>(T model) { this.model = model as FastModel; _fast = new FastDetector( this.model.Threshold, this.model.NonMaxSupression, this.model.Type ); }
private void GetPropertiesAndSetModel() { try { var type = Enum.GetValues(typeof(DetectorType)).Cast <DetectorType>().First(x => x.ToString() == comboBox1.SelectedItem.ToString()); var model = new FastModel() { Type = type, Threshold = int.Parse(textBox1.Text), NonMaxSupression = checkBox1.Checked }; _fast.UpdateModel(model); this.Close(); } catch (Exception e) { } }