/// <summary>
        /// Validates this instance.
        /// </summary>
        /// <returns></returns>
        public override bool Validate()
        {
            bool result = false;
            var  valid  = !string.IsNullOrWhiteSpace(Items) &&
                          QueryType == SitecoreQueryType.CreateVersion;

            if (!valid)
            {
                result = false;
            }
            // either an item id or query must be provided
            if (!string.IsNullOrWhiteSpace(ItemId))
            {
                valid = ItemId.IsSitecoreId();
            }
            if (valid)
            {
                result = true;
            }
            return(result);
        }
Esempio n. 2
0
        /// <summary>
        /// Validates this instance.
        /// </summary>
        /// <returns></returns>
        public override bool Validate()
        {
            var valid = !string.IsNullOrWhiteSpace(Template) &&
                        !string.IsNullOrWhiteSpace(Name) &&
                        QueryType == SitecoreQueryType.Create;

            if (!valid)
            {
                return(false);
            }

            // either an item id or query must be provided
            if (!string.IsNullOrWhiteSpace(ItemId))
            {
                valid = ItemId.IsSitecoreId();
            }

            if (valid)
            {
                return(true);
            }

            return(!string.IsNullOrWhiteSpace(ParentQuery));
        }
 /// <summary>
 /// Validates this instance.
 /// </summary>
 /// <returns></returns>
 public override bool Validate()
 {
     return(ItemId.IsSitecoreId());
 }