/// <summary> /// Add an instance to the model. /// </summary> /// <param name="instance">The instance to add to the Model.</param> /// <exception cref="DuplicateInstanceException">Another instance already exists in the model with the same id.</exception> public void AddInstance(BaseIfc instance) { if (instances.ContainsKey(instance.Id)) { throw new DuplicateInstanceException(instance.Id); } instances.Add(instance.Id, instance); }
private void RemoveAggregationRelationships(BaseIfc obj) { var relationships = storage.AllInstancesOfType <IfcRelAggregates>().Where(r => r.RelatedObjects.Contains(obj)).ToList(); for (var i = relationships.Count() - 1; i >= 0; i--) { storage.RemoveInstance(relationships[i].Id); } }
public void UpdateInstance(BaseIfc instance) { throw new NotImplementedException(); }