示例#1
0
 public override Difference Resolve(
     ConflictContext context,
     OperationTypeConflictResolver operationTypeConflictResolver,
     ValueConflictResolver valueConflictResolver)
 {
     return(operationTypeConflictResolver(context.CreateSubcontext(this), r_differenceInSourceBranch, r_differenceInDestinationBranch));
 }
        public MergeSolutionsForm(
                NodeDifference differenceInSourceBranch,
                NodeDifference differenceInDestinationBranch,
                Conflict conflict,
                OperationTypeConflictResolver operationTypeConflictResolver,
                ValueConflictResolver valueConflictResolver)
        {
            InitializeComponent();
            FormPosition.LoadFromRegistry(this);

            m_differencesInSourceBranchControl.Data = differenceInSourceBranch;
            m_differencesInDestinationBranchControl.Data = differenceInDestinationBranch;
            m_conflict = conflict as NodeConflict;
            m_operationTypeConflictResolver = operationTypeConflictResolver;
            m_valueConflictResolver = valueConflictResolver;
            if (m_conflict.Subconflicts.Count == 0)
            {
                m_result = (NodeDifference)m_conflict.Resolve(m_operationTypeConflictResolver, m_valueConflictResolver);
            }
            else
            {
                m_result = null;
            }

            UpdateUI();
        }
        public override Difference Resolve(
                    ConflictContext context,
                    OperationTypeConflictResolver operationTypeConflictResolver,
                    ValueConflictResolver valueConflictResolver)
        {
            foreach (var subconflict in new List<Conflict>(r_subconflicts)) // Iterate on a copy of the list to be able to modify the original list in the loop
            {
                var resolvedDifference = subconflict.Resolve(context.CreateSubcontext(this), operationTypeConflictResolver, valueConflictResolver);
                if (resolvedDifference != null)
                {
                    r_subconflicts.Remove(subconflict);
                    r_acceptedSubdifferences.Add(resolvedDifference);
                }
            }

            if (r_subconflicts.Count == 0)
            {
                return new NodeDifference(
                            this.Identifier,
                            r_operationOnParent,
                            r_acceptedSubdifferences);
            }
            else
            {
                return null;
            }
        }
示例#4
0
        public override Difference Resolve(
            ConflictContext context,
            OperationTypeConflictResolver operationTypeConflictResolver,
            ValueConflictResolver valueConflictResolver)
        {
            foreach (var subconflict in new List <Conflict>(r_subconflicts)) // Iterate on a copy of the list to be able to modify the original list in the loop
            {
                var resolvedDifference = subconflict.Resolve(context.CreateSubcontext(this), operationTypeConflictResolver, valueConflictResolver);
                if (resolvedDifference != null)
                {
                    r_subconflicts.Remove(subconflict);
                    r_acceptedSubdifferences.Add(resolvedDifference);
                }
            }

            if (r_subconflicts.Count == 0)
            {
                return(new NodeDifference(
                           this.Identifier,
                           r_operationOnParent,
                           r_acceptedSubdifferences));
            }
            else
            {
                return(null);
            }
        }
 public override Difference Resolve(
             ConflictContext context,
             OperationTypeConflictResolver operationTypeConflictResolver,
             ValueConflictResolver valueConflictResolver)
 {
     return operationTypeConflictResolver(context.CreateSubcontext(this), r_differenceInSourceBranch, r_differenceInDestinationBranch);
 }
示例#6
0
        public MergeSolutionsForm(
            NodeDifference differenceInSourceBranch,
            NodeDifference differenceInDestinationBranch,
            Conflict conflict,
            OperationTypeConflictResolver operationTypeConflictResolver,
            ValueConflictResolver valueConflictResolver)
        {
            InitializeComponent();
            FormPosition.LoadFromRegistry(this);

            m_differencesInSourceBranchControl.Data      = differenceInSourceBranch;
            m_differencesInDestinationBranchControl.Data = differenceInDestinationBranch;
            m_conflict = conflict as NodeConflict;
            m_operationTypeConflictResolver = operationTypeConflictResolver;
            m_valueConflictResolver         = valueConflictResolver;
            if (m_conflict.Subconflicts.Count == 0)
            {
                m_result = (NodeDifference)m_conflict.Resolve(m_operationTypeConflictResolver, m_valueConflictResolver);
            }
            else
            {
                m_result = null;
            }

            UpdateUI();
        }
示例#7
0
 public override Difference Resolve(
             ConflictContext context,
             OperationTypeConflictResolver operationTypeConflictResolver,
             ValueConflictResolver valueConflictResolver)
 {
     var resolvedValue = valueConflictResolver(context.CreateSubcontext(this), r_newValueInSourceBranch, r_newValueInDestinationBranch);
     return resolvedValue == null
                 ? null
                 : new ValueDifference(this.Identifier, this.OperationOnParent, r_oldValue, resolvedValue);
 }
示例#8
0
        public override Difference Resolve(
            ConflictContext context,
            OperationTypeConflictResolver operationTypeConflictResolver,
            ValueConflictResolver valueConflictResolver)
        {
            var resolvedValue = valueConflictResolver(context.CreateSubcontext(this), r_newValueInSourceBranch, r_newValueInDestinationBranch);

            return(resolvedValue == null
                        ? null
                        : new ValueDifference(this.Identifier, this.OperationOnParent, r_oldValue, resolvedValue));
        }
示例#9
0
 public abstract Difference Resolve(
     ConflictContext context,
     OperationTypeConflictResolver operationTypeConflictResolver,
     ValueConflictResolver valueConflictResolver);
示例#10
0
 public Difference Resolve(
     OperationTypeConflictResolver operationTypeConflictResolver,
     ValueConflictResolver valueConflictResolver)
 {
     return(Resolve(new ConflictContext(), operationTypeConflictResolver, valueConflictResolver));
 }
示例#11
0
 public abstract Difference Resolve(
                 ConflictContext context,
                 OperationTypeConflictResolver operationTypeConflictResolver,
                 ValueConflictResolver valueConflictResolver);
示例#12
0
 public Difference Resolve(
             OperationTypeConflictResolver operationTypeConflictResolver,
             ValueConflictResolver valueConflictResolver)
 {
     return Resolve(new ConflictContext(), operationTypeConflictResolver, valueConflictResolver);
 }