public override void Update(ConfigurationSection rootNode, API api) { FollowedDriver = (int)api.GetData("CamCarIdx"); CurrentCamera = (int)api.GetData("CamGroupNumber"); List <Dictionary <string, object> > groups = rootNode.GetMapList("CameraInfo.Groups"); if (groups.Count == Cameras.Count) { return; } foreach (Dictionary <string, object> dict in groups) { int id = int.Parse(dict.GetDictValue("GroupNum")); if (Cameras.FindIndex(c => c.Id == id) >= 0) { continue; } Camera cam = new Camera(); cam.Id = id; cam.Name = dict.GetDictValue("GroupName"); Cameras.Add(cam); } }