예제 #1
0
        public static bool IsReadOnlyType(this CslaObjectType cslaType)
        {
            if (cslaType.IsReadOnlyCollection() ||
                cslaType.IsReadOnlyObject())
            {
                return(true);
            }

            return(false);
        }
예제 #2
0
        public static bool IsCollectionType(this CslaObjectType cslaType)
        {
            if (cslaType.IsEditableRootCollection() ||
                cslaType.IsEditableChildCollection() ||
                cslaType.IsDynamicEditableRootCollection() ||
                cslaType.IsReadOnlyCollection())
            {
                return(true);
            }

            return(false);
        }
예제 #3
0
        /// <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);
        }
예제 #4
0
 public static bool IsNotReadOnlyCollection(this CslaObjectType cslaType)
 {
     return(!cslaType.IsReadOnlyCollection());
 }