public virtual void Before(Net.Vpc.Upa.EntityPart item, int index) { Net.Vpc.Upa.EntityPart oldParent = item.GetParent(); if (oldParent != null) { if (!(oldParent is Net.Vpc.Upa.Section) && !(oldParent is Net.Vpc.Upa.CompoundField)) { throw new System.ArgumentException("Field Parent is neither a Field Section nor a Field"); } } defaultEntity.BeforePartAdded(null, item, index); if (oldParent != null) { if (oldParent is Net.Vpc.Upa.Section) { Net.Vpc.Upa.Section x = (Net.Vpc.Upa.Section)oldParent; x.RemovePartAt(x.IndexOfPart(item)); } else if (oldParent is Net.Vpc.Upa.CompoundField) { Net.Vpc.Upa.CompoundField x = (Net.Vpc.Upa.CompoundField)oldParent; ((Net.Vpc.Upa.Impl.DefaultCompoundField)x).DropFieldAt(x.IndexOfField((Net.Vpc.Upa.PrimitiveField)item)); } } // Net.Vpc.Upa.Impl.Util.DefaultBeanAdapter a = new Net.Vpc.Upa.Impl.Util.DefaultBeanAdapter(item); if (oldParent != null) { a.InjectNull("parent"); } a.SetProperty("entity", defaultEntity); }
public virtual void Before(Net.Vpc.Upa.EntityPart child, int index) { Net.Vpc.Upa.EntityPart oldParent = child.GetParent(); // ((DefaultEntity) defaultSection.getEntity()).beforePartAdded(defaultSection, child, index); if (oldParent != null && oldParent != defaultSection) { if (oldParent is Net.Vpc.Upa.Section) { Net.Vpc.Upa.Section x = (Net.Vpc.Upa.Section)oldParent; x.RemovePartAt(x.IndexOfPart(child)); } } Net.Vpc.Upa.Impl.Util.DefaultBeanAdapter adapter = new Net.Vpc.Upa.Impl.Util.DefaultBeanAdapter(child); if (oldParent != defaultSection) { adapter.SetProperty("parent", defaultSection); } adapter.SetProperty("entity", defaultSection.GetEntity()); }
public virtual void After(Net.Vpc.Upa.PrimitiveField child, int index) { Net.Vpc.Upa.EntityPart oldParent = child.GetParent(); if (oldParent != null && oldParent != defaultCompoundField) { if (oldParent is Net.Vpc.Upa.Section) { Net.Vpc.Upa.Section x = (Net.Vpc.Upa.Section)oldParent; x.RemovePartAt(x.IndexOfPart(child)); } else if (oldParent is Net.Vpc.Upa.CompoundField) { Net.Vpc.Upa.CompoundField x = (Net.Vpc.Upa.CompoundField)oldParent; ((Net.Vpc.Upa.Impl.DefaultCompoundField)x).DropFieldAt(x.IndexOfField(child)); } } if (oldParent != defaultCompoundField) { Net.Vpc.Upa.Impl.Util.DefaultBeanAdapter adapter = new Net.Vpc.Upa.Impl.Util.DefaultBeanAdapter(child); adapter.SetProperty("parent", defaultCompoundField); } }