Exemplo n.º 1
0
		/// <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;
				}
			}
		}
Exemplo n.º 2
0
		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();
					}
				}
			}
		}
Exemplo n.º 3
0
		public static DslModeling::LinkedElementCollection<Role> GetRoleCollection(EntityType element)
		{
			return new DslModeling::LinkedElementCollection<Role>(element, EntityTypeDomainRoleId);
		}
Exemplo n.º 4
0
		public static void SetEntityType(Role element, EntityType newEntityType)
		{
			DslModeling::DomainRoleInfo.SetLinkedElement(element, RoleDomainRoleId, newEntityType);
		}
Exemplo n.º 5
0
		/// <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)
		{
		}
Exemplo n.º 6
0
		public static void SetSupertype(EntityType element, EntityType newSupertype)
		{
			DslModeling::DomainRoleInfo.SetLinkedElement(element, SubtypeDomainRoleId, newSupertype);
		}
Exemplo n.º 7
0
		public static EntityType GetSupertype(EntityType element)
		{
			return DslModeling::DomainRoleInfo.GetLinkedElement(element, SubtypeDomainRoleId) as EntityType;
		}
Exemplo n.º 8
0
		public static DslModeling::LinkedElementCollection<EntityType> GetSubtypesCollection(EntityType element)
		{
			return new DslModeling::LinkedElementCollection<EntityType>(element, SupertypeDomainRoleId);
		}
Exemplo n.º 9
0
		/// <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)
		{
		}
Exemplo n.º 10
0
		/// <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)
		{
		}
Exemplo n.º 11
0
		public static void SetBarkerErModel(EntityType element, BarkerErModel newBarkerErModel)
		{
			DslModeling::DomainRoleInfo.SetLinkedElement(element, EntityTypeDomainRoleId, newBarkerErModel);
		}
Exemplo n.º 12
0
		public static BarkerErModel GetBarkerErModel(EntityType element)
		{
			return DslModeling::DomainRoleInfo.GetLinkedElement(element, EntityTypeDomainRoleId) as BarkerErModel;
		}
Exemplo n.º 13
0
		/// <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)
		{
		}
Exemplo n.º 14
0
		public static DslModeling::LinkedElementCollection<Attribute> GetAttributeCollection(EntityType element)
		{
			return GetRoleCollection<DslModeling::LinkedElementCollection<Attribute>, Attribute>(element, EntityTypeDomainRoleId);
		}