コード例 #1
0
        protected override bool InternalEqualsTo(DefaultableMulti other)
        {
            OrmTypeDiscriminatorValueAttribute otherAttr = (OrmTypeDiscriminatorValueAttribute)other;

            return(this.Value.EqualsTo(otherAttr.Value) &&
                   this.Default && otherAttr.Default);
        }
コード例 #2
0
        public IOrmAttribute MergeChanges(IOrmAttribute otherAttribute, MergeConflictAction mergeConflictAction)
        {
            OrmTypeDiscriminatorValueAttribute other        = (OrmTypeDiscriminatorValueAttribute)otherAttribute;
            OrmTypeDiscriminatorValueAttribute mergedResult = new OrmTypeDiscriminatorValueAttribute();

            bool enabled = this.Enabled;

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

            mergedResult.Enabled = enabled;

            Defaultable <bool> mergedDefault = GetDefaultAsDefaultable().Merge(other.GetDefaultAsDefaultable(), mergeConflictAction);

            mergedResult.Default = mergedDefault.Value;

            ObjectValue value = this.Value;

            if (!this.Value.EqualsTo(other.Value) && other.Enabled && mergeConflictAction == MergeConflictAction.TakeOther)
            {
                value = other.Value;
            }

            mergedResult.Value = value;

            return(mergedResult);
        }
コード例 #3
0
 protected override void InternalAssignFrom(DefaultableMulti other)
 {
     if (other is OrmTypeDiscriminatorValueAttribute)
     {
         OrmTypeDiscriminatorValueAttribute attr = (OrmTypeDiscriminatorValueAttribute)other;
         this.Enabled = attr.Enabled;
         this.Default = attr.Default;
         this.Value   = attr.Value.Clone();
     }
 }