public static void IgnoreAllChildren(this IFolder folder, string deviceId = "*") {
if (deviceId == null) {
throw new ArgumentException("Given deviceId is null or empty");
}
Dictionary<string, object> properties = new Dictionary<string, object>();
IList<string> devices = folder.IgnoredDevices();
if (!devices.Contains(deviceId.ToLower())) {
devices.Add(deviceId.ToLower());
}
properties.Add("gds:ignoreDeviceIds", devices);
IList<string> ids = folder.SecondaryObjectTypeIds();
if (!ids.Contains("gds:sync")) {
ids.Add("gds:sync");
properties.Add(PropertyIds.SecondaryObjectTypeIds, ids);
}
folder.UpdateProperties(properties, true);
}