public void SetValue(object input, object value, XmlSerializationContext context) { if (!context.IsBlocked(input, this)) { var modelElement = (ModelElement)input; modelElement.SetReferencedElement(Reference, value as IModelElement); if (Opposite != null) { context.BlockProperty(value, Opposite); } } }
public void AddToCollection(object input, object item, XmlSerializationContext context) { if (!context.IsBlocked(input, this)) { var modelElement = (ModelElement)input; modelElement.GetReferencedElements(Reference).Add(item); if (Opposite != null) { context.BlockProperty(item, Opposite); } } }