Exemple #1
0
 internal void InitFromCreationInformation(ViewCreationInformation creation)
 {
     if (creation != null)
     {
         base.ObjectData.Properties["Title"] = creation.Title;
         base.ObjectData.Properties["Paged"] = creation.Paged;
     }
 }
        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);
        }