Example #1
0
        // Editing ObjectCharacteristics
        private void ObjectsListView_ItemActivate(object sender, EventArgs e)
        {
            ListViewItem          item    = ObjectsListView.SelectedItems[0];
            ObjectCharacteristics objChar = (ObjectCharacteristics)item.Tag;

            using (ObjectDefinitionDialog dlg = new ObjectDefinitionDialog(objChar))
            {
                DialogResult result = dlg.ShowDialog();
                if (result == DialogResult.OK)
                {
                    objChar.ObjectType        = dlg.ObjectType;
                    objChar.Confidence        = dlg.Confidence;
                    objChar.MinPercentOverlap = dlg.Overlap;
                    objChar.MinimumXSize      = dlg.MinX;
                    objChar.MinimumYSize      = dlg.MinY;
                    objChar.TimeFrame         = dlg.History;
                }
            }
        }
Example #2
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            using (ObjectDefinitionDialog dlg = new ObjectDefinitionDialog())
            {
                DialogResult result = dlg.ShowDialog();
                if (result == DialogResult.OK)
                {
                    ListViewItem item = new ListViewItem(new string[] { dlg.ObjectType, dlg.Confidence.ToString(), dlg.Overlap.ToString(), dlg.MinX.ToString(), dlg.MinY.ToString(), dlg.History.ToString() });
                    item = ObjectsListView.Items.Add(item);
                    ObjectCharacteristics objChar = new ObjectCharacteristics();
                    objChar.ObjectType        = dlg.ObjectType;
                    objChar.Confidence        = dlg.Confidence;
                    objChar.MinPercentOverlap = dlg.Overlap;
                    objChar.MinimumXSize      = dlg.MinX;
                    objChar.MinimumYSize      = dlg.MinY;
                    objChar.TimeFrame         = dlg.History;

                    item.Tag = objChar;
                }
            }
        }