public List<Item> getchikldren(List<Item> oItem)
{
List<Item> oCams = new List<Item>();
foreach (Item childSite in oItem)
{
if (childSite.FQID.Kind == Kind.Camera && childSite.FQID.FolderType == FolderType.No) oCams.Add(childSite);
oCams.AddRange(getchikldren(childSite.GetChildren()));
}
return oCams;
}
public List<Item> GetCameras(Item oItem)
{
List<Item> oCams = new List<Item>();
if (oItem.HasChildren != VideoOS.Platform.HasChildren.No)
{
if (oItem.FQID.Kind == Kind.Camera && oItem.FQID.FolderType == FolderType.No) oCams.Add(oItem);
oCams = getchikldren(oItem.GetChildren());
}
return oCams;
}
Configuration oInstance = Configuration.Instance;
List<VideoOS.Platform.Item> oItems = oInstance.GetItems();
Cams = GetCameras(oItems[0]);
This is the code i’m using to get all camera instances, but it returns dupliactes of all the cameras..what am i doing wrong? ie its returning 26 Items instead of 13