void _pg_config_SelectedGridItemChanged(object sender, SelectedGridItemChangedEventArgs e) { if (_current != null) { _current.ReleaseInteraction(); _current = null; } Type r = e.NewSelection.PropertyDescriptor.PropertyType; Core.Addins.AddinInfo suitable = _interactors.FirstOrDefault( ai => ai.Attribute<UI.InteractionResultTypeAttribute>().ResultType == r); if (suitable != null) { _current = Core.Addins.AddinStore.CreateInstance(suitable) as UI.I2DInteractor; _current.InteractionCompleted += new EventHandler<Parsley.UI.InteractionEventArgs>(_current_InteractionCompleted); _current.UnscaledSize = _context.Setup.Camera.FrameSize; _current.InteractOn(_context.EmbeddableStream.PictureBox); } }
void FrameGrabber_OnFramePrepend(Parsley.Core.BuildingBlocks.FrameGrabber fp, Emgu.CV.Image <Emgu.CV.Structure.Bgr, byte> img) { UI.I2DInteractor i = _current; if (i != null) { if (i.State == Parsley.UI.InteractionState.Interacting) { _current.DrawIndicator(i.Current, img); } else { GridItem e = _pg_config.SelectedGridItem; GridItem p = e.Parent; if (p != null) { _current.DrawIndicator(e.PropertyDescriptor.GetValue(p.Value), img); } } } }
void _pg_config_SelectedGridItemChanged(object sender, SelectedGridItemChangedEventArgs e) { if (_current != null) { _current.ReleaseInteraction(); _current = null; } Type r = e.NewSelection.PropertyDescriptor.PropertyType; Core.Addins.AddinInfo suitable = _interactors.FirstOrDefault( ai => ai.Attribute <UI.InteractionResultTypeAttribute>().ResultType == r); if (suitable != null) { _current = Core.Addins.AddinStore.CreateInstance(suitable) as UI.I2DInteractor; _current.InteractionCompleted += new EventHandler <Parsley.UI.InteractionEventArgs>(_current_InteractionCompleted); _current.UnscaledSize = _context.Setup.Camera.FrameSize; _current.InteractOn(_context.EmbeddableStream.PictureBox); } }