CmisSync.Lib.Cmis.ConvenienceExtenders.CmisConvenienceExtenders.IgnoreAllChildren C# (CSharp) Method

IgnoreAllChildren() public static method

Sets a flag to ignores all children of this folder.
public static IgnoreAllChildren ( this folder, string deviceId = "*" ) : void
folder this Folder which children should be ignored.
deviceId string Device Ids which should be ignored.
return void
        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);
        }