/// <summary> /// Cache the location of any entity shape associated with the provided <see cref="ObjectType"/> and <see cref="EntityType"/> /// </summary> private static void RememberBarkerEntityShapeLocations(ObjectType objectType, EntityType entity) { foreach (PresentationElement pel in PresentationViewsSubject.GetPresentation(entity)) { BarkerEntityShape shape = pel as BarkerEntityShape; if (pel != null) { Dictionary<object, object> context = objectType.Store.TransactionManager.CurrentTransaction.TopLevelTransaction.Context.ContextInfo; object tablePositionsObject; Dictionary<Guid, PointD> barkerEntityPositions; if (!context.TryGetValue(BarkerEntityPositionDictionaryKey, out tablePositionsObject) || (barkerEntityPositions = tablePositionsObject as Dictionary<Guid, PointD>) == null) { context[BarkerEntityPositionDictionaryKey] = barkerEntityPositions = new Dictionary<Guid, PointD>(); } barkerEntityPositions[objectType.Id] = shape.Location; } } }
private static void UpdateEntityPresentationSize(EntityType table) { if (table != null) { foreach (PresentationElement pel in PresentationViewsSubject.GetPresentation(table)) { BarkerEntityShape shape; AttributeElementListCompartment compartment; if (null != (shape = pel as BarkerEntityShape) && null != (compartment = shape.FindCompartment("AttributesCompartment") as AttributeElementListCompartment)) { compartment.InvalidateOrUpdateSize(); } } } }
public static DslModeling::LinkedElementCollection<Role> GetRoleCollection(EntityType element) { return new DslModeling::LinkedElementCollection<Role>(element, EntityTypeDomainRoleId); }
public static void SetEntityType(Role element, EntityType newEntityType) { DslModeling::DomainRoleInfo.SetLinkedElement(element, RoleDomainRoleId, newEntityType); }
/// <summary> /// Constructor /// Creates a EntityTypePlaysRole link in the same Partition as the given EntityType /// </summary> /// <param name="source">EntityType to use as the source of the relationship.</param> /// <param name="target">Role to use as the target of the relationship.</param> public EntityTypePlaysRole(EntityType source, Role target) : base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(EntityTypePlaysRole.EntityTypeDomainRoleId, source), new DslModeling::RoleAssignment(EntityTypePlaysRole.RoleDomainRoleId, target)}, null) { }
public static void SetSupertype(EntityType element, EntityType newSupertype) { DslModeling::DomainRoleInfo.SetLinkedElement(element, SubtypeDomainRoleId, newSupertype); }
public static EntityType GetSupertype(EntityType element) { return DslModeling::DomainRoleInfo.GetLinkedElement(element, SubtypeDomainRoleId) as EntityType; }
public static DslModeling::LinkedElementCollection<EntityType> GetSubtypesCollection(EntityType element) { return new DslModeling::LinkedElementCollection<EntityType>(element, SupertypeDomainRoleId); }
/// <summary> /// Constructor /// Creates a EntityTypeHasAttribute link in the same Partition as the given EntityType /// </summary> /// <param name="source">EntityType to use as the source of the relationship.</param> /// <param name="target">Attribute to use as the target of the relationship.</param> public EntityTypeHasAttribute(EntityType source, Attribute target) : base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(EntityTypeHasAttribute.EntityTypeDomainRoleId, source), new DslModeling::RoleAssignment(EntityTypeHasAttribute.AttributeDomainRoleId, target)}, null) { }
/// <summary> /// Constructor /// Creates a EntityTypeIsSubtypeOfEntityType link in the same Partition as the given EntityType /// </summary> /// <param name="source">EntityType to use as the source of the relationship.</param> /// <param name="target">EntityType to use as the target of the relationship.</param> public EntityTypeIsSubtypeOfEntityType(EntityType source, EntityType target) : base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(EntityTypeIsSubtypeOfEntityType.SubtypeDomainRoleId, source), new DslModeling::RoleAssignment(EntityTypeIsSubtypeOfEntityType.SupertypeDomainRoleId, target)}, null) { }
public static void SetBarkerErModel(EntityType element, BarkerErModel newBarkerErModel) { DslModeling::DomainRoleInfo.SetLinkedElement(element, EntityTypeDomainRoleId, newBarkerErModel); }
public static BarkerErModel GetBarkerErModel(EntityType element) { return DslModeling::DomainRoleInfo.GetLinkedElement(element, EntityTypeDomainRoleId) as BarkerErModel; }
/// <summary> /// Constructor /// Creates a BarkerErModelContainsEntityType link in the same Partition as the given BarkerErModel /// </summary> /// <param name="source">BarkerErModel to use as the source of the relationship.</param> /// <param name="target">EntityType to use as the target of the relationship.</param> public BarkerErModelContainsEntityType(BarkerErModel source, EntityType target) : base((source != null ? source.Partition : null), new DslModeling::RoleAssignment[]{new DslModeling::RoleAssignment(BarkerErModelContainsEntityType.BarkerErModelDomainRoleId, source), new DslModeling::RoleAssignment(BarkerErModelContainsEntityType.EntityTypeDomainRoleId, target)}, null) { }
public static DslModeling::LinkedElementCollection<Attribute> GetAttributeCollection(EntityType element) { return GetRoleCollection<DslModeling::LinkedElementCollection<Attribute>, Attribute>(element, EntityTypeDomainRoleId); }