private void ExecuteFilter(Type t, Image img) { try { // Initialize instance FilterCore filter = (FilterCore)System.Activator.CreateInstance(t); // Setup instance (if necessary ...) SortedDictionary<string, object> configs = filter.GetDefaultConfigs(); if (null != configs) { ConfigurationsForm conf = new ConfigurationsForm(ref configs); if (conf.ShowDialog() == System.Windows.Forms.DialogResult.Cancel) return; } // Execute filter, get new image ... Image ret = filter.ApplyFilter(img, configs); ret.Tag = Facilities.CloneTag(img); Facilities.AddFilterExecution(ref ret, filter, configs); ImageForm ret_form = new ImageForm(ret); ret_form.MdiParent = MdiParent; ret_form.Mode = Mode; ret_form.Show(); } catch (Exception e) { MessageBox.Show(e.Message, e.GetType().FullName); } }
private void OpenHashConfig_CurrentRow() { if (null != GridAlgorithms.CurrentRow) { RowBatchAlgorithm row = (RowBatchAlgorithm)GridAlgorithms.CurrentRow.DataBoundItem; if (null != row) { SortedDictionary<string, object> hash = row.Item2; ConfigurationsForm conf = new ConfigurationsForm(ref hash); conf.ShowDialog(this); } } }
// User interaction with the AlgorithmsGrid private void OpenHashConfigCurrentRow() { try { if (null != gridAlgorithms.CurrentRow) { RowBatchFilter row = (RowBatchFilter)gridAlgorithms.CurrentRow.DataBoundItem; if (null != row) { SortedDictionary<string, object> hash = row.Item2; ConfigurationsForm conf = new ConfigurationsForm(ref hash); conf.ShowDialog(this); } } } catch (Exception ex) { MessageBox.Show(ex.GetType().FullName, ex.Message); } }