Esempio n. 1
0
        public override void DeserializeFromXml(XmlReader reader)
        {
            OrmAssociationEnd associationEnd = new OrmAssociationEnd();

            associationEnd.DeserializeFromXml(reader);
            this.AssignFrom(associationEnd);
        }
Esempio n. 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));
 }
Esempio n. 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;
 }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 6
0
 public void AssignInternalsFrom(OrmAssociationEnd other)
 {
     this.owner = other.owner;
     this.endId = other.endId;
 }
Esempio n. 7
0
 public AssociationInfo(OrmAssociationEnd source)
 {
     AssignFrom(source);
 }