Ejemplo n.º 1
0
        /// <summary>
        /// Gets all IRelationship contained in the graph.
        /// </summary>
        public IRelationship[] GetAllRelationships()
        {
            int size =
                Relationships.Count +
                SubclassRelationships.Count +
                PropertyRelationships.Count +
                EquivalenceRelationships.Count;

            List <IRelationship> all = new List <IRelationship>(size);

            foreach (Relationship r in Relationships.GetItems())
            {
                all.Add(r);
            }
            foreach (SubclassRelationship sr in SubclassRelationships.GetItems())
            {
                all.Add(sr);
            }
            foreach (PropertyRelationship pr in PropertyRelationships.GetItems())
            {
                all.Add(pr);
            }
            foreach (EquivalenceRelationship er in EquivalenceRelationships.GetItems())
            {
                all.Add(er);
            }
            return(all.ToArray());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns all classes from graph related with propertyEntity by PropertyRelationship.
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public IEntitySet <IClassEntity> GetClasses(IPropertyEntity entity)
        {
            IEntitySet <IClassEntity> temp = new EntitySet <IClassEntity>();

            foreach (PropertyRelationship pr in PropertyRelationships.GetItems())
            {
                if (pr.Property.Identity == entity.Identity)
                {
                    temp.Add(pr.Class);
                }
            }
            return(temp);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds PropertyRelationship to the graph.
 /// </summary>
 /// <param name="propertyRelationship"></param>
 public void Add(PropertyRelationship propertyRelationship)
 {
     PropertyRelationships.Add(propertyRelationship);
 }