示例#1
0
        public void Remove(Group group)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient && group == null)
            {
                throw ClientUtility.CreateArgumentNullException("group");
            }
            ClientAction query = new ClientActionInvokeMethod(this, "Remove", new object[]
            {
                group
            });

            context.AddQuery(query);
            base.RemoveChild(group);
        }
示例#2
0
        public Folder Add(string url)
        {
            ClientRuntimeContext context = base.Context;
            Folder folder = new Folder(context, new ObjectPathMethod(context, base.Path, "Add", new object[]
            {
                url
            }));

            folder.Path.SetPendingReplace();
            ObjectIdentityQuery objectIdentityQuery = new ObjectIdentityQuery(folder.Path);

            context.AddQueryIdAndResultObject(objectIdentityQuery.Id, folder);
            context.AddQuery(objectIdentityQuery);
            base.AddChild(folder);
            return(folder);
        }
        internal virtual void SetFieldValue(string fieldName, object value)
        {
            ClientRuntimeContext context = base.Context;

            this.FieldValues[fieldName] = value;
            ClientAction query = new ClientActionInvokeMethod(this, "SetFieldValue", new object[]
            {
                fieldName,
                value
            });

            if (context != null)
            {
                context.AddQuery(query);
            }
        }
        public void Add(string strField)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient && strField == null)
            {
                throw ClientUtility.CreateArgumentNullException("strField");
            }
            ClientAction query = new ClientActionInvokeMethod(this, "Add", new object[]
            {
                strField
            });

            context.AddQuery(query);
            this.OnAdd(strField);
        }
        public ClientResult <string> GetValueForUICulture(string cultureName)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient)
            {
                if (cultureName == null)
                {
                    throw ClientUtility.CreateArgumentNullException("cultureName");
                }
                if (cultureName != null && cultureName.Length == 0)
                {
                    throw ClientUtility.CreateArgumentException("cultureName");
                }
            }
            object obj;
            Dictionary <string, ClientResult <string> > dictionary;

            if (base.ObjectData.MethodReturnObjects.TryGetValue("GetValueForUICulture", out obj))
            {
                dictionary = (Dictionary <string, ClientResult <string> >)obj;
            }
            else
            {
                dictionary = new Dictionary <string, ClientResult <string> >();
                base.ObjectData.MethodReturnObjects["GetValueForUICulture"] = dictionary;
            }
            ClientResult <string> clientResult = null;

            if (!context.DisableReturnValueCache && dictionary.TryGetValue(cultureName, out clientResult))
            {
                return(clientResult);
            }
            ClientAction clientAction = new ClientActionInvokeMethod(this, "GetValueForUICulture", new object[]
            {
                cultureName
            });

            context.AddQuery(clientAction);
            clientResult = new ClientResult <string>();
            context.AddQueryIdAndResultObject(clientAction.Id, clientResult);
            if (!context.DisableReturnValueCache)
            {
                dictionary[cultureName] = clientResult;
            }
            return(clientResult);
        }
        public static ClientResult <int> GetContentVerFromTag(ClientRuntimeContext context, string contentTag)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            ClientAction clientAction = new ClientActionInvokeStaticMethod(context, "{df28be1e-74b5-4b21-b73a-2bbac0a23d8a}", "GetContentVerFromTag", new object[]
            {
                contentTag
            });

            context.AddQuery(clientAction);
            ClientResult <int> clientResult = new ClientResult <int>();

            context.AddQueryIdAndResultObject(clientAction.Id, clientResult);
            return(clientResult);
        }
示例#7
0
        public Field AddDependentLookup(string displayName, Field primaryLookupField, string lookupField)
        {
            ClientRuntimeContext context = base.Context;
            Field field = new Field(context, new ObjectPathMethod(context, base.Path, "AddDependentLookup", new object[]
            {
                displayName,
                primaryLookupField,
                lookupField
            }));

            field.Path.SetPendingReplace();
            ObjectIdentityQuery objectIdentityQuery = new ObjectIdentityQuery(field.Path);

            context.AddQueryIdAndResultObject(objectIdentityQuery.Id, field);
            context.AddQuery(objectIdentityQuery);
            base.AddChild(field);
            return(field);
        }
        public ClientResult <BasePermissions> GetUserEffectivePermissions(string userName)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient && userName == null)
            {
                throw ClientUtility.CreateArgumentNullException("userName");
            }
            ClientAction clientAction = new ClientActionInvokeMethod(this, "GetUserEffectivePermissions", new object[]
            {
                userName
            });

            context.AddQuery(clientAction);
            ClientResult <BasePermissions> clientResult = new ClientResult <BasePermissions>();

            context.AddQueryIdAndResultObject(clientAction.Id, clientResult);
            return(clientResult);
        }
        public ClientResult <string> ExportWebPart(Guid webPartId)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient && webPartId == Guid.Empty)
            {
                throw ClientUtility.CreateArgumentException("webPartId");
            }
            ClientAction clientAction = new ClientActionInvokeMethod(this, "ExportWebPart", new object[]
            {
                webPartId
            });

            context.AddQuery(clientAction);
            ClientResult <string> clientResult = new ClientResult <string>();

            context.AddQueryIdAndResultObject(clientAction.Id, clientResult);
            return(clientResult);
        }
        public RoleAssignment GetByPrincipal(Principal principalToFind)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient && principalToFind == null)
            {
                throw ClientUtility.CreateArgumentNullException("principalToFind");
            }
            RoleAssignment roleAssignment = new RoleAssignment(context, new ObjectPathMethod(context, base.Path, "GetByPrincipal", new object[]
            {
                principalToFind
            }));

            roleAssignment.Path.SetPendingReplace();
            ObjectIdentityQuery objectIdentityQuery = new ObjectIdentityQuery(roleAssignment.Path);

            context.AddQueryIdAndResultObject(objectIdentityQuery.Id, roleAssignment);
            context.AddQuery(objectIdentityQuery);
            return(roleAssignment);
        }
        public WebPartDefinition AddWebPart(WebPart webPart, string zoneId, int zoneIndex)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient)
            {
                if (webPart == null)
                {
                    throw ClientUtility.CreateArgumentNullException("webPart");
                }
                if (zoneId == null)
                {
                    throw ClientUtility.CreateArgumentNullException("zoneId");
                }
                if (zoneId != null && zoneId.Length == 0)
                {
                    throw ClientUtility.CreateArgumentException("zoneId");
                }
                if (zoneId != null && zoneId.Length > 64)
                {
                    throw ClientUtility.CreateArgumentException("zoneId");
                }
                if (zoneIndex < 0)
                {
                    throw ClientUtility.CreateArgumentException("zoneIndex");
                }
            }
            WebPartDefinition webPartDefinition = new WebPartDefinition(context, new ObjectPathMethod(context, base.Path, "AddWebPart", new object[]
            {
                webPart,
                zoneId,
                zoneIndex
            }));

            webPartDefinition.Path.SetPendingReplace();
            ObjectIdentityQuery objectIdentityQuery = new ObjectIdentityQuery(webPartDefinition.Path);

            context.AddQueryIdAndResultObject(objectIdentityQuery.Id, webPartDefinition);
            context.AddQuery(objectIdentityQuery);
            return(webPartDefinition);
        }
示例#12
0
        public File Add(FileCreationInformation parameters)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient)
            {
                if (parameters == null)
                {
                    throw ClientUtility.CreateArgumentNullException("parameters");
                }
                if (parameters != null)
                {
                    if (parameters.Url == null)
                    {
                        throw ClientUtility.CreateArgumentNullException("parameters.Url");
                    }
                    Uri uri;
                    if (parameters.Url != null && !Uri.TryCreate(parameters.Url, UriKind.RelativeOrAbsolute, out uri))
                    {
                        throw ClientUtility.CreateArgumentException("parameters.Url");
                    }
                    if (parameters.Url != null && parameters.Url.Length < 1)
                    {
                        throw ClientUtility.CreateArgumentException("parameters.Url");
                    }
                }
            }
            File file = new File(context, new ObjectPathMethod(context, base.Path, "Add", new object[]
            {
                parameters
            }));

            file.Path.SetPendingReplace();
            ObjectIdentityQuery objectIdentityQuery = new ObjectIdentityQuery(file.Path);

            context.AddQueryIdAndResultObject(objectIdentityQuery.Id, file);
            context.AddQuery(objectIdentityQuery);
            base.AddChild(file);
            file.InitFromCreationInformation(parameters);
            return(file);
        }
        public IList <ListItemFormUpdateValue> ValidateUpdateListItem(IList <ListItemFormUpdateValue> formValues, bool bNewDocumentUpdate, string checkInComment)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient && formValues == null)
            {
                throw ClientUtility.CreateArgumentNullException("formValues");
            }
            ClientAction clientAction = new ClientActionInvokeMethod(this, "ValidateUpdateListItem", new object[]
            {
                formValues,
                bNewDocumentUpdate,
                checkInComment
            });

            context.AddQuery(clientAction);
            IList <ListItemFormUpdateValue> list = new List <ListItemFormUpdateValue>();

            context.AddQueryIdAndResultObject(clientAction.Id, new ClientListResultHandler <ListItemFormUpdateValue>(list));
            return(list);
        }
示例#14
0
        public Field Add(Field field)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient && field == null)
            {
                throw ClientUtility.CreateArgumentNullException("field");
            }
            Field field2 = new Field(context, new ObjectPathMethod(context, base.Path, "Add", new object[]
            {
                field
            }));

            field2.Path.SetPendingReplace();
            ObjectIdentityQuery objectIdentityQuery = new ObjectIdentityQuery(field2.Path);

            context.AddQueryIdAndResultObject(objectIdentityQuery.Id, field2);
            context.AddQuery(objectIdentityQuery);
            base.AddChild(field2);
            return(field2);
        }
示例#15
0
        public ContentType AddExistingContentType(ContentType contentType)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient && contentType == null)
            {
                throw ClientUtility.CreateArgumentNullException("contentType");
            }
            ContentType contentType2 = new ContentType(context, new ObjectPathMethod(context, base.Path, "AddExistingContentType", new object[]
            {
                contentType
            }));

            contentType2.Path.SetPendingReplace();
            ObjectIdentityQuery objectIdentityQuery = new ObjectIdentityQuery(contentType2.Path);

            context.AddQueryIdAndResultObject(objectIdentityQuery.Id, contentType2);
            context.AddQuery(objectIdentityQuery);
            base.AddChild(contentType2);
            return(contentType2);
        }
示例#16
0
        public ContentType Add(ContentTypeCreationInformation parameters)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient)
            {
                if (parameters == null)
                {
                    throw ClientUtility.CreateArgumentNullException("parameters");
                }
                if (parameters != null)
                {
                    if (parameters.Name == null)
                    {
                        throw ClientUtility.CreateArgumentNullException("parameters.Name");
                    }
                    if (parameters.Group != null && parameters.Group.Length < 1)
                    {
                        throw ClientUtility.CreateArgumentException("parameters.Group");
                    }
                    if (parameters.Group != null && parameters.Group.Length > 128)
                    {
                        throw ClientUtility.CreateArgumentException("parameters.Group");
                    }
                }
            }
            ContentType contentType = new ContentType(context, new ObjectPathMethod(context, base.Path, "Add", new object[]
            {
                parameters
            }));

            contentType.Path.SetPendingReplace();
            ObjectIdentityQuery objectIdentityQuery = new ObjectIdentityQuery(contentType.Path);

            context.AddQueryIdAndResultObject(objectIdentityQuery.Id, contentType);
            context.AddQuery(objectIdentityQuery);
            base.AddChild(contentType);
            contentType.InitFromCreationInformation(parameters);
            return(contentType);
        }
示例#17
0
        public Folder AddUsingPath(ResourcePath path, FolderCollectionAddParameters parameters)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient && path == null)
            {
                throw ClientUtility.CreateArgumentNullException("path");
            }
            Folder folder = new Folder(context, new ObjectPathMethod(context, base.Path, "AddUsingPath", new object[]
            {
                path,
                parameters
            }));

            folder.Path.SetPendingReplace();
            ObjectIdentityQuery objectIdentityQuery = new ObjectIdentityQuery(folder.Path);

            context.AddQueryIdAndResultObject(objectIdentityQuery.Id, folder);
            context.AddQuery(objectIdentityQuery);
            base.AddChild(folder);
            return(folder);
        }
        public WorkflowAssociation Add(WorkflowAssociationCreationInformation parameters)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient && parameters == null)
            {
                throw ClientUtility.CreateArgumentNullException("parameters");
            }
            WorkflowAssociation workflowAssociation = new WorkflowAssociation(context, new ObjectPathMethod(context, base.Path, "Add", new object[]
            {
                parameters
            }));

            workflowAssociation.Path.SetPendingReplace();
            ObjectIdentityQuery objectIdentityQuery = new ObjectIdentityQuery(workflowAssociation.Path);

            context.AddQueryIdAndResultObject(objectIdentityQuery.Id, workflowAssociation);
            context.AddQuery(objectIdentityQuery);
            base.AddChild(workflowAssociation);
            workflowAssociation.InitFromCreationInformation(parameters);
            return(workflowAssociation);
        }
        public void RestoreByLabel(string versionlabel)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient)
            {
                if (versionlabel == null)
                {
                    throw ClientUtility.CreateArgumentNullException("versionlabel");
                }
                if (versionlabel != null && versionlabel.Length == 0)
                {
                    throw ClientUtility.CreateArgumentException("versionlabel");
                }
            }
            ClientAction query = new ClientActionInvokeMethod(this, "RestoreByLabel", new object[]
            {
                versionlabel
            });

            context.AddQuery(query);
        }
        public void SetValueForUICulture(string cultureName, string value)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient)
            {
                if (cultureName == null)
                {
                    throw ClientUtility.CreateArgumentNullException("cultureName");
                }
                if (cultureName != null && cultureName.Length == 0)
                {
                    throw ClientUtility.CreateArgumentException("cultureName");
                }
            }
            ClientAction query = new ClientActionInvokeMethod(this, "SetValueForUICulture", new object[]
            {
                cultureName,
                value
            });

            context.AddQuery(query);
        }
        public void MoveFieldTo(string field, int index)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient)
            {
                if (field == null)
                {
                    throw ClientUtility.CreateArgumentNullException("field");
                }
                if (index < 0)
                {
                    throw ClientUtility.CreateArgumentException("index");
                }
            }
            ClientAction query = new ClientActionInvokeMethod(this, "MoveFieldTo", new object[]
            {
                field,
                index
            });

            context.AddQuery(query);
        }
        public void CopyTo(string strNewUrl, bool bOverWrite)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient)
            {
                if (strNewUrl == null)
                {
                    throw ClientUtility.CreateArgumentNullException("strNewUrl");
                }
                Uri uri;
                if (strNewUrl != null && !Uri.TryCreate(strNewUrl, UriKind.RelativeOrAbsolute, out uri))
                {
                    throw ClientUtility.CreateArgumentException("strNewUrl");
                }
            }
            ClientAction query = new ClientActionInvokeMethod(this, "CopyTo", new object[]
            {
                strNewUrl,
                bOverWrite
            });

            context.AddQuery(query);
        }
        public void MoveTo(string newUrl, MoveOperations flags)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient)
            {
                if (newUrl == null)
                {
                    throw ClientUtility.CreateArgumentNullException("newUrl");
                }
                Uri uri;
                if (newUrl != null && !Uri.TryCreate(newUrl, UriKind.RelativeOrAbsolute, out uri))
                {
                    throw ClientUtility.CreateArgumentException("newUrl");
                }
            }
            ClientAction query = new ClientActionInvokeMethod(this, "MoveTo", new object[]
            {
                newUrl,
                flags
            });

            context.AddQuery(query);
        }
        public List Add(ListCreationInformation parameters)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient)
            {
                if (parameters == null)
                {
                    throw ClientUtility.CreateArgumentNullException("parameters");
                }
                if (parameters != null)
                {
                    if (parameters.Title == null)
                    {
                        throw ClientUtility.CreateArgumentNullException("parameters.Title");
                    }
                    if (parameters.Title != null && parameters.Title.Length > 255)
                    {
                        throw ClientUtility.CreateArgumentException("parameters.Title");
                    }
                }
            }
            List list = new List(context, new ObjectPathMethod(context, base.Path, "Add", new object[]
            {
                parameters
            }));

            list.Path.SetPendingReplace();
            ObjectIdentityQuery objectIdentityQuery = new ObjectIdentityQuery(list.Path);

            context.AddQueryIdAndResultObject(objectIdentityQuery.Id, list);
            context.AddQuery(objectIdentityQuery);
            base.AddChild(list);
            list.InitFromCreationInformation(parameters);
            return(list);
        }
        public View Add(ViewCreationInformation parameters)
        {
            ClientRuntimeContext context = base.Context;

            if (base.Context.ValidateOnClient)
            {
                if (parameters == null)
                {
                    throw ClientUtility.CreateArgumentNullException("parameters");
                }
                if (parameters != null)
                {
                    if (parameters.Title != null && parameters.Title.Length > 255)
                    {
                        throw ClientUtility.CreateArgumentException("parameters.Title");
                    }
                    if (parameters.RowLimit > 2147483647u)
                    {
                        throw ClientUtility.CreateArgumentException("parameters.RowLimit");
                    }
                }
            }
            View view = new View(context, new ObjectPathMethod(context, base.Path, "Add", new object[]
            {
                parameters
            }));

            view.Path.SetPendingReplace();
            ObjectIdentityQuery objectIdentityQuery = new ObjectIdentityQuery(view.Path);

            context.AddQueryIdAndResultObject(objectIdentityQuery.Id, view);
            context.AddQuery(objectIdentityQuery);
            base.AddChild(view);
            view.InitFromCreationInformation(parameters);
            return(view);
        }
        protected virtual void MapRegionalSettings(ClientRuntimeContext context, RegionalSettings settings, RegionalSettingsDefinition definition,
                                                   out bool shouldUpdate)
        {
            shouldUpdate = false;

            if (!SupportSetters(settings))
            {
                return;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "AdjustHijriDays") &&
                definition.AdjustHijriDays.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "AdjustHijriDays", definition.AdjustHijriDays.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "AlternateCalendarType") &&
                definition.AlternateCalendarType.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "AlternateCalendarType", definition.AlternateCalendarType.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "CalendarType") &&
                definition.CalendarType.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "CalendarType", definition.CalendarType.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "Collation") &&
                definition.Collation.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "Collation", definition.Collation.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "FirstDayOfWeek") &&
                definition.FirstDayOfWeek.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "FirstDayOfWeek", definition.FirstDayOfWeek.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "FirstWeekOfYear") &&
                definition.FirstWeekOfYear.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "FirstWeekOfYear", definition.FirstWeekOfYear.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "LocaleId") &&
                definition.LocaleId.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "LocaleId", definition.LocaleId.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "WorkDayStartHour") &&
                definition.WorkDayStartHour.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "WorkDayStartHour", definition.WorkDayStartHour.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "WorkDayEndHour") &&
                definition.WorkDayEndHour.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "WorkDayEndHour", definition.WorkDayEndHour.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "WorkDays") &&
                definition.WorkDays.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "WorkDays", definition.WorkDays.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "ShowWeeks") &&
                definition.ShowWeeks.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "ShowWeeks", definition.ShowWeeks.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "Time24") &&
                definition.Time24.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "Time24", definition.Time24.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "TimeZone") &&
                definition.TimeZoneId.HasValue)
            {
                var targetZone = settings.TimeZones
                                 .ToArray()
                                 .FirstOrDefault(z => z.Id == definition.TimeZoneId.Value);

                if (targetZone == null)
                {
                    throw new SPMeta2Exception(
                              string.Format("Cannot find TimeZone by ID:[{0}]", definition.TimeZoneId));
                }

                context.AddQuery(new ClientActionSetProperty(settings, "TimeZone", targetZone));
                shouldUpdate = true;
            }
        }
示例#27
0
        protected virtual void MapRegionalSettings(ClientRuntimeContext context, RegionalSettings settings, RegionalSettingsDefinition definition,
                                                   out bool shouldUpdate)
        {
            shouldUpdate = false;

            if (!SupportSetters(settings))
            {
                return;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "AdjustHijriDays") &&
                definition.AdjustHijriDays.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "AdjustHijriDays", definition.AdjustHijriDays.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "AlternateCalendarType") &&
                definition.AlternateCalendarType.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "AlternateCalendarType", definition.AlternateCalendarType.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "CalendarType") &&
                definition.CalendarType.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "CalendarType", definition.CalendarType.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "Collation") &&
                definition.Collation.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "Collation", definition.Collation.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "FirstDayOfWeek") &&
                definition.FirstDayOfWeek.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "FirstDayOfWeek", definition.FirstDayOfWeek.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "FirstWeekOfYear") &&
                definition.FirstWeekOfYear.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "FirstWeekOfYear", definition.FirstWeekOfYear.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "LocaleId") &&
                definition.LocaleId.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "LocaleId", definition.LocaleId.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "WorkDayStartHour") &&
                definition.WorkDayStartHour.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "WorkDayStartHour", definition.WorkDayStartHour.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "WorkDayEndHour") &&
                definition.WorkDayEndHour.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "WorkDayEndHour", definition.WorkDayEndHour.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "WorkDays") &&
                definition.WorkDays.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "WorkDays", definition.WorkDays.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "ShowWeeks") &&
                definition.ShowWeeks.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "ShowWeeks", definition.ShowWeeks.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "Time24") &&
                definition.Time24.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "Time24", definition.Time24.Value));
                shouldUpdate = true;
            }
        }
        protected virtual void MapRegionalSettings(ClientRuntimeContext context, RegionalSettings settings, RegionalSettingsDefinition definition,
            out bool shouldUpdate)
        {
            shouldUpdate = false;

            if (!SupportSetters(settings))
                return;

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "AdjustHijriDays")
                && definition.AdjustHijriDays.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "AdjustHijriDays", definition.AdjustHijriDays.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "AlternateCalendarType")
                && definition.AlternateCalendarType.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "AlternateCalendarType", definition.AlternateCalendarType.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "CalendarType")
                && definition.CalendarType.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "CalendarType", definition.CalendarType.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "Collation")
                && definition.Collation.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "Collation", definition.Collation.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "FirstDayOfWeek")
                && definition.FirstDayOfWeek.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "FirstDayOfWeek", definition.FirstDayOfWeek.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "FirstWeekOfYear")
                && definition.FirstWeekOfYear.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "FirstWeekOfYear", definition.FirstWeekOfYear.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "LocaleId")
                && definition.LocaleId.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "LocaleId", definition.LocaleId.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "WorkDayStartHour")
                && definition.WorkDayStartHour.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "WorkDayStartHour", definition.WorkDayStartHour.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "WorkDayEndHour")
                && definition.WorkDayEndHour.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "WorkDayEndHour", definition.WorkDayEndHour.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "WorkDays")
                && definition.WorkDays.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "WorkDays", definition.WorkDays.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "ShowWeeks")
                && definition.ShowWeeks.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "ShowWeeks", definition.ShowWeeks.Value));
                shouldUpdate = true;
            }

            if (ReflectionUtils.HasPropertyPublicSetter(settings, "Time24")
                && definition.Time24.HasValue)
            {
                context.AddQuery(new ClientActionSetProperty(settings, "Time24", definition.Time24.Value));
                shouldUpdate = true;
            }
        }