예제 #1
0
        public override void DeserializeFromXml(XmlReader reader)
        {
            OrmAssociationEnd associationEnd = new OrmAssociationEnd();

            associationEnd.DeserializeFromXml(reader);
            this.AssignFrom(associationEnd);
        }
예제 #2
0
 public bool EqualsTo(OrmAssociationEnd other)
 {
     return(this.multiplicity == other.multiplicity &&
            this.OnOwnerRemove == other.OnOwnerRemove &&
            this.OnTargetRemove == other.OnTargetRemove &&
            this.UseAssociationAttribute == other.UseAssociationAttribute &&
            this.pairTo.EqualsTo(other.pairTo));
 }
예제 #3
0
 private void AssignFrom(OrmAssociationEnd source)
 {
     this.Multiplicity            = source.Multiplicity;
     this.OnOwnerRemove           = source.OnOwnerRemove;
     this.OnTargetRemove          = source.OnTargetRemove;
     this.PairTo                  = (Defaultable <string>)source.PairTo.Clone();
     this.UseAssociationAttribute = source.UseAssociationAttribute;
 }
예제 #4
0
        public OrmAssociationEnd ToOrmAssociationEnd()
        {
            OrmAssociationEnd associationEnd = new OrmAssociationEnd();

            associationEnd.multiplicity            = this.Multiplicity;
            associationEnd.OnOwnerRemove           = this.OnOwnerRemove;
            associationEnd.OnTargetRemove          = this.OnTargetRemove;
            associationEnd.UseAssociationAttribute = this.UseAssociationAttribute;
            associationEnd.PairTo = (Defaultable <string>) this.PairTo.Clone();
            return(associationEnd);
        }
예제 #5
0
        public override object CreateInstance(ITypeDescriptorContext context, IDictionary propertyValues)
        {
            ModelElement      owner      = context.Instance as ModelElement;
            OrmAssociationEnd currentObj = (OrmAssociationEnd)context.PropertyDescriptor.GetValue(context.Instance);

            MultiplicityKind          otherMultiplicity   = (MultiplicityKind)propertyValues["Multiplicity"];
            AssociationOnRemoveAction otherOnOwnerRemove  = (AssociationOnRemoveAction)propertyValues["OnOwnerRemove"];
            AssociationOnRemoveAction otherOnTargetRemove = (AssociationOnRemoveAction)propertyValues["OnTargetRemove"];
            Defaultable <string>      otherPairTo         = (Defaultable <string>)propertyValues["PairTo"];
            bool useAssociationAttribute = (bool)propertyValues["UseAssociationAttribute"];

            bool changedMultiplicity = currentObj.Multiplicity != otherMultiplicity;
            bool changedPairTo       = !currentObj.PairTo.EqualsTo(otherPairTo);

            string endId = context.PropertyDescriptor.Name;

            OrmAssociationEnd result = new OrmAssociationEnd(owner, endId)
            {
                multiplicity            = otherMultiplicity,
                OnOwnerRemove           = otherOnOwnerRemove,
                OnTargetRemove          = otherOnTargetRemove,
                pairTo                  = otherPairTo,
                UseAssociationAttribute = useAssociationAttribute
            };

//            if (changedMultiplicity)
//            {
//                result.NotifyValueChangeToOwner("Multiplicity");
//            }

            //if (changedPairTo)
            {
                result.NotifyValueChangeToOwner(string.Empty, endId);
            }

            return(result);
        }
예제 #6
0
 public void AssignInternalsFrom(OrmAssociationEnd other)
 {
     this.owner = other.owner;
     this.endId = other.endId;
 }
예제 #7
0
 public AssociationInfo(OrmAssociationEnd source)
 {
     AssignFrom(source);
 }