protected IObject[] GetObjects(ISession session, Composite objectType) { if (session is IDatabaseSession) { return session.Extent(objectType); } var workspaceSess = (IWorkspaceSession)session; return workspaceSess.LocalExtent(objectType); }
public static void SetComposite(this ModelMetadata modelMetadata, Composite value) { modelMetadata.AdditionalValues[CompositeKey] = value; }
protected IObject[] GetObjects(ISession session, Composite objectType) { return session.Extent(objectType); }
public Tree(Composite composite) { this.composite = composite; this.nodes = new List<TreeNode>(); }
private bool HasCycle(Composite originalSubtype, Interface currentSupertype, HashSet<Interface> supertypes, Dictionary<Composite, List<Inheritance>> inheritancesBySubtype) { if (originalSubtype is Interface && supertypes.Contains((Interface)originalSubtype)) { return true; } if (!supertypes.Contains(currentSupertype)) { supertypes.Add(currentSupertype); List<Inheritance> currentSuperInheritances; if (inheritancesBySubtype.TryGetValue(currentSupertype, out currentSuperInheritances)) { foreach (var inheritance in currentSuperInheritances) { var newSupertype = inheritance.Supertype; if (newSupertype != null) { if (this.HasCycle(originalSubtype, newSupertype, supertypes, inheritancesBySubtype)) { return true; } } } } } return false; }
private bool HasCycle(Composite subtype, HashSet<Interface> supertypes, Dictionary<Composite, List<Inheritance>> inheritancesBySubtype) { foreach (var inheritance in inheritancesBySubtype[subtype]) { var supertype = inheritance.Supertype; if (supertype != null) { if (this.HasCycle(subtype, supertype, supertypes, inheritancesBySubtype)) { return true; } } } return false; }
private static PropertyType Resolve(Composite composite, string propertyName) { var lowerCasePropertyName = propertyName.ToLowerInvariant(); foreach (var roleType in composite.RoleTypes) { if (roleType.SingularName.ToLowerInvariant().Equals(lowerCasePropertyName) || roleType.SingularFullName.ToLowerInvariant().Equals(lowerCasePropertyName) || roleType.PluralName.ToLowerInvariant().Equals(lowerCasePropertyName) || roleType.PluralFullName.ToLowerInvariant().Equals(lowerCasePropertyName)) { return roleType; } } foreach (var associationType in composite.AssociationTypes) { if (associationType.SingularName.ToLowerInvariant().Equals(lowerCasePropertyName) || associationType.SingularFullName.ToLowerInvariant().Equals(lowerCasePropertyName) || associationType.SingularPropertyName.ToLowerInvariant().Equals(lowerCasePropertyName) || associationType.PluralName.ToLowerInvariant().Equals(lowerCasePropertyName) || associationType.PluralFullName.ToLowerInvariant().Equals(lowerCasePropertyName) || associationType.PluralPropertyName.ToLowerInvariant().Equals(lowerCasePropertyName)) { return associationType; } } return null; }
public static bool TryParse(Composite composite, string pathString, out Path path) { var propertyType = Resolve(composite, pathString); path = propertyType == null ? null : new Path(propertyType); return path != null; }