public bool IsUpdaterType(CslaObjectType cslaType)
        {
            if (cslaType.IsEditableRoot() ||
                cslaType.IsEditableChild() ||
                cslaType.IsDynamicEditableRoot() ||
                cslaType.IsEditableSwitchable())
            {
                return(true);
            }

            return(false);
        }
Example #2
0
        public static bool IsObjectType(this CslaObjectType cslaType)
        {
            if (cslaType.IsEditableRoot() ||
                cslaType.IsEditableChild() ||
                cslaType.IsEditableSwitchable() ||
                cslaType.IsDynamicEditableRoot() ||
                cslaType.IsReadOnlyObject())
            {
                return(true);
            }

            return(false);
        }
        // ParentType1 - root stereotypes can't have parent
        private static bool CanHaveParent(CslaObjectType child)
        {
            _specificErrorMessage = "A Root stereotype cannot have a parent.";

            if (child.IsEditableRoot() ||
                child.IsEditableRootCollection() ||
                child.IsDynamicEditableRootCollection())
            {
                BrokenRuleMsg  = "\r\nRelation rule: " + _specificErrorMessage + " * * *\r\n";
                BrokenRuleMsg += child + " cannot have a ParentType.";
                return(false);
            }

            return(true);
        }
        /// <summary>
        /// Determines whether the specified <paramref name="stereotype"/> is allowed to have no parent.
        /// </summary>
        /// <param name="stereotype">The candidate stereotype.</param>
        /// <returns>
        ///     <c>true</c> if the specified <paramref name="stereotype"/> is allowed to have no parent; otherwise, <c>false</c>.
        /// </returns>
        /// <remarks>This is "ParentType1" - root stereotypes don't have a parent.</remarks>
        public static bool IsNoParentAllowed(CslaObjectType stereotype)
        {
            _specificErrorMessage = string.Empty;
            BrokenRuleMsg         = string.Empty;

            if (stereotype.IsEditableRoot() ||
                stereotype.IsEditableRootCollection() ||
                stereotype.IsDynamicEditableRootCollection() ||
                stereotype.IsReadOnlyObject() ||
                stereotype.IsReadOnlyCollection() ||
                stereotype.IsBaseClass() ||
                stereotype.IsCriteriaClass())
            {
                return(true);
            }

            BrokenRuleMsg = stereotype + " must have a ParentType.";
            return(false);
        }
Example #5
0
 public static bool IsNotEditableRoot(this CslaObjectType cslaType)
 {
     return(!cslaType.IsEditableRoot());
 }