No, the ItemPickerForm is limited to return one item only.
It is possible to use it to pick one camera group instead of one camera.
Camera groups will typically be setup in the Management Client.
No, the ItemPickerForm is limited to return one item only.
It is possible to use it to pick one camera group instead of one camera.
Camera groups will typically be setup in the Management Client.
I was asked how to enable the ItemPickerForm to pick one camera group. Please see this snippet of code:
private void buttonSelectCameraGroup_Click(object sender, EventArgs e)
{
ItemPickerForm form = new ItemPickerForm();
form.ValidateSelectionEvent += Form_ValidateSelectionEvent;
form.KindFilter = Kind.Camera;
form.Init(Configuration.Instance.GetItems(ItemHierarchy.UserDefined));
if (form.ShowDialog() == DialogResult.OK)
{
MessageBox.Show(form.SelectedItem.Name);
}
form.ValidateSelectionEvent -= Form_ValidateSelectionEvent;
}
private void Form_ValidateSelectionEvent(ItemPickerForm.ValidateEventArgs e)
{
if ((e.Item.FQID.Kind == Kind.Camera || e.Item.FQID.Kind == Kind.Folder) && e.Item.FQID.FolderType != FolderType.No)
e.AcceptSelection = true;
}