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