示例#1
0
 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);
         }
     }
 }
示例#2
0
 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);
         }
     }
 }