Inconvenient displaying views

We have a problem when we want to display the views in a .net (windows forms) application. We are using the “Component Integration” type integration and the ItemPickerForm class. In principle, we do not have problems showing the cameras, however, when we want to show the views, they show us as if they did not exist. Permissions have been validated against the connecting user but we still can’t have a successful test. In the first photo is the test with the cameras and it can be seen that it lists them without any problem (Warehouse Camera). In the second photo, it does not show us any view.

First Photo

Second Photo

The objective is to be able to select a view and show what the cameras related to that view are seeing. As seen in the Xprotect Smart Client.

OBJETIVE:

My code:

ItemPickerForm picker = new ItemPickerForm();

  //Configuration.Instance.GetViewGroups();

  picker.KindFilter = Kind.View;

  picker.Init(Configuration.Instance.GetItems());

  if (picker.ShowDialog() == DialogResult.OK)

  {

    selectedItem = picker.SelectedItem;

    try

    {

I would appreciate in principle please why the lists are not observed

The MIP configuration in component integration, standalone applications, does not include views.

Only as a plugin integration running within the Smart Client does the MIP configuration include views.

This is historically justified, from the start views were only ever used in the domain of the Smart Client.

There is a workaround, later Milestone developed the Configuration API, this can be used in standalone as well as in plugins.

You can see this in use if you explore the Config API Client sample.

https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/configapiclient/readme.html&tree=tree_2.html

https://github.com/milestonesys

I have a small snippet that might be relevant using the strongly typed classes in the Configuration API..

using VideoOS.Platform;
using VideoOS.Platform.ConfigurationItems;
 
private void ShowViews(ViewGroup viewGroup)
{
    if (viewGroup == null)
    {
        return;
    }
    label1.Text += "ViewGroup " + viewGroup.Name + Environment.NewLine;
    var viewfolder = viewGroup.ViewFolder;
    if (viewfolder != null)
    {
        var views = viewfolder.Views;
        foreach (var view in views)
        {
            label1.Text += "View " + view.Name + Environment.NewLine;
        }
    }
 
    //children
    var vgChildFolder = viewGroup.ViewGroupFolder;
    if (vgChildFolder != null)
    {
        var vgChildGroups = vgChildFolder.ViewGroups;
        if (vgChildGroups != null)
        {
            foreach (var vgGroup in vgChildGroups)
            {
                if (vgGroup != null)
                {
                    ShowViews(vgGroup);
                }
            }
        }
    }
}

I am going to implement it in my code. Thank you Bo Ellegård.