/// <summary> /// Determines whether <paramref name="parent"/> can have the specified <paramref name="child"/>. /// </summary> /// <param name="parent">The parent candidate.</param> /// <param name="child">The child candidate.</param> /// <returns> /// <c>true</c> if <paramref name="parent"/> can have the specified <paramref name="child"/>; otherwise, <c>false</c>. /// </returns> public static bool IsChildAllowed(CslaObjectType parent, CslaObjectType child) { _specificErrorMessage = string.Empty; BrokenRuleMsg = string.Empty; bool?result; ChildType1_LoadData(); result = ChildType(parent, child); if (result != null) { return(result == true); } ChildType2_LoadData(); result = ChildType(parent, child); if (result != null) { return(result == true); } ChildType3_LoadData(); result = ChildType(parent, child); if (result != null) { return(result == true); } ChildType4_LoadData(); result = ChildType(parent, child); if (result != null) { return(result == true); } ChildType5_LoadData(); result = ChildType(parent, child); if (result != null) { return(result == true); } return(false); }
/// <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); }
public static bool IsCriteriaClass(this CslaObjectType cslaType) { return(cslaType == CslaObjectType.CriteriaClass); }
public static bool IsNotUnitOfWork(this CslaObjectType cslaType) { return(!cslaType.IsUnitOfWork()); }
public static bool IsNotEditableRoot(this CslaObjectType cslaType) { return(!cslaType.IsEditableRoot()); }
private string GetTemplateName(CslaObjectType type) { return(String.Format("{0}.cst", type.ToString())); }
public static bool IsNotPlaceHolder(this CslaObjectType cslaType) { return(!cslaType.IsPlaceHolder()); }
public static bool IsNotBaseClass(this CslaObjectType cslaType) { return(!cslaType.IsBaseClass()); }
public static bool IsReadOnlyObject(this CslaObjectType cslaType) { return(cslaType == CslaObjectType.ReadOnlyObject); }
public static bool IsNotEditableChildCollection(this CslaObjectType cslaType) { return(!cslaType.IsEditableChildCollection()); }
public static bool IsEditableChildCollection(this CslaObjectType cslaType) { return(cslaType == CslaObjectType.EditableChildCollection); }
public static bool IsNotDynamicEditableRootCollection(this CslaObjectType cslaType) { return(!cslaType.IsDynamicEditableRootCollection()); }
public static bool IsDynamicEditableRootCollection(this CslaObjectType cslaType) { return(cslaType == CslaObjectType.DynamicEditableRootCollection); }
public static bool IsNotEditableSwitchable(this CslaObjectType cslaType) { return(!cslaType.IsEditableSwitchable()); }
public static bool IsEditableSwitchable(this CslaObjectType cslaType) { return(cslaType == CslaObjectType.EditableSwitchable); }
public static bool IsNotCriteriaClass(this CslaObjectType cslaType) { return(!cslaType.IsCriteriaClass()); }
public static bool IsBaseClass(this CslaObjectType cslaType) { return(cslaType == CslaObjectType.BaseClass); }
public static bool IsReadOnlyCollection(this CslaObjectType cslaType) { return(cslaType == CslaObjectType.ReadOnlyCollection); }
public static bool IsPlaceHolder(this CslaObjectType cslaType) { return(cslaType == CslaObjectType.PlaceHolder); }
public static bool IsNotReadOnlyCollection(this CslaObjectType cslaType) { return(!cslaType.IsReadOnlyCollection()); }
public static bool IsNameValueList(this CslaObjectType cslaType) { return(cslaType == CslaObjectType.NameValueList); }
public static bool IsNotNameValueList(this CslaObjectType cslaType) { return(!cslaType.IsNameValueList()); }
private void NewCollection(CslaObjectType type, string name, string item) { NewCollection(type, name, item, String.Empty); }
public static bool IsUnitOfWork(this CslaObjectType cslaType) { return(cslaType == CslaObjectType.UnitOfWork); }
/// <summary> /// Initializes a new instance of the ObjectFactory class. /// </summary> /// <param name="currentUnit"></param> /// <param name="type"></param> public ObjectFactory(CslaGeneratorUnit currentUnit, CslaObjectType type) { _currentUnit = currentUnit; _currentCslaObject = new CslaObjectInfo(_currentUnit); _currentCslaObject.ObjectType = type; }
public static bool IsEditableRoot(this CslaObjectType cslaType) { return(cslaType == CslaObjectType.EditableRoot); }