Esempio n. 1
0
        protected override bool InternalEqualsTo(DefaultableMulti other)
        {
            OrmKeyAttribute otherAttr = (OrmKeyAttribute)other;

            return(this.Position.EqualsTo(otherAttr.Position) &&
                   this.Direction.EqualsTo(otherAttr.Direction));
        }
Esempio n. 2
0
 protected override void InternalAssignFrom(DefaultableMulti other)
 {
     if (other is OrmKeyAttribute)
     {
         OrmKeyAttribute attr = (OrmKeyAttribute)other;
         this.Enabled   = attr.Enabled;
         this.Position  = (Defaultable <int>)attr.Position.Clone();
         this.Direction = (Defaultable <KeyDirection>)attr.Direction.Clone();
     }
 }
Esempio n. 3
0
        public IOrmAttribute MergeChanges(IOrmAttribute otherAttribute, MergeConflictAction mergeConflictAction)
        {
            OrmKeyAttribute other        = (OrmKeyAttribute)otherAttribute;
            OrmKeyAttribute mergedResult = new OrmKeyAttribute();

            bool enabled = this.Enabled;

            //if (!other.Enabled && mergeConflictAction == MergeConflictAction.TakeOther)
            if (other.Enabled && !enabled && mergeConflictAction == MergeConflictAction.TakeOther)
            {
                enabled = other.Enabled;
            }

            mergedResult.Enabled = enabled;

            mergedResult.Direction = this.Direction.Merge(other.Direction, mergeConflictAction);
            mergedResult.Position  = this.Position.Merge(other.Position, mergeConflictAction);

            return(mergedResult);
        }