public IModelElement GetReferencedElement(Meta.IReference reference, int index = 0) { if (reference == null) { throw new ArgumentNullException("reference"); } return(GetModelElementForReference(reference.Name.ToUpperInvariant(), 0)); }
/// <summary> /// Sets the referenced element of the current model element for the given reference /// </summary> /// <param name="reference">The reference</param> /// <param name="element">The element that should be set</param> public void SetReferencedElement(Meta.IReference reference, IModelElement element) { if (reference == null) { throw new ArgumentNullException("reference"); } SetFeature(reference.Name.ToUpperInvariant(), element); }
public static INotifyExpression <IModelElement> GetReferencedElement(ModelElement element, Meta.IReference reference, int index) { if (reference == null) { throw new ArgumentOutOfRangeException("reference"); } if (reference.UpperBound == 1) { return(element.GetExpressionForReference(reference.Name.ToUpperInvariant())); } throw new NotSupportedException(); }
/// <summary> /// Gets the referenced elements of the current model element for the given reference /// </summary> /// <param name="reference">The reference</param> /// <returns>A collection of referenced elements</returns> public IList GetReferencedElements(Meta.IReference reference) { return(GetCollectionForFeature(reference.Name.ToUpperInvariant())); }
/// <summary> /// Gets the referenced elements of the current model element for the given reference /// </summary> /// <param name="reference">The reference</param> /// <returns>A collection of referenced elements</returns> public IList GetReferencedElements(Meta.IReference reference) { throw new ArgumentOutOfRangeException("reference"); }