コード例 #1
0
 public VCUserPromptConflict(ConflictType conflictType, string message, string scopeHint)
     : base(conflictType,
            Status.Unresolved,
            message,
            scopeHint)
 {
 }
コード例 #2
0
 public static bool IsResolutionRuleScopeValid(
     ConflictType conflictType,
     string ruleScopeToValidate,
     out string hint)
 {
     return(conflictType.ScopeInterpreter.IsResolutionRuleScopeValid(ruleScopeToValidate, out hint));
 }
コード例 #3
0
            /// <summary>
            /// Select the active conflicts that can be resolved by a rule with certain scope.
            /// </summary>
            /// <param name="conflicts"></param>
            /// <param name="conflictType"></param>
            /// <param name="ruleScope"></param>
            /// <returns></returns>
            public static MigrationConflict[] GetResolvableConflictListByScope(
                MigrationConflict[] conflicts,
                ConflictType conflictType,
                string ruleScope)
            {
                List <MigrationConflict> resolvableConflicts = new List <MigrationConflict>(conflicts.Length);

                string hint;

                if (IsResolutionRuleScopeValid(conflictType, ruleScope, out hint))
                {
                    foreach (MigrationConflict conflict in conflicts)
                    {
                        // filter out incompatible conflicts (those of other types)
                        if (!conflict.ConflictType.ReferenceName.Equals(conflictType.ReferenceName))
                        {
                            continue;
                        }

                        // select those whose ScopeHint is in 'ruleScope'
                        if (conflictType.ScopeInterpreter.IsInScope(conflict.ScopeHint, ruleScope))
                        {
                            resolvableConflicts.Add(conflict);
                        }
                    }
                }

                return(resolvableConflicts.ToArray());
            }
 public VCChangeGroupInProgressConflict(ConflictType conflictType, string message, string scopeHint)
     : base(conflictType,
            Status.Unresolved,
            message,
            scopeHint)
 {
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MigrationConflict"/> class.
 /// </summary>
 /// <param name="conflictType">Specifies the type of conflict being created.</param>
 /// <param name="conflictStatus">Specifies the conflict status.</param>
 /// <param name="conflictDetails">Specifies the conflict details.</param>
 /// <param name="scopeHint">Specifies the scope hint used during conflict resolution.</param>
 public MigrationConflict(
     ConflictType conflictType,
     Status conflictStatus,
     string conflictDetails,
     string scopeHint)
 {
     Initializer(conflictType, conflictStatus, conflictDetails, scopeHint, conflictType.TranslateConflictDetailsToReadableDescription);
 }
コード例 #6
0
        private void Initializer(
            ConflictType conflictType,
            Status conflictStatus,
            string conflictDetails,
            string scopeHint,
            TranslateConflictDetailsToReadableDescription translator)
        {
            if (null == conflictType)
            {
                throw new ArgumentNullException("conflictType");
            }
            if (null == translator)
            {
                throw new ArgumentNullException("translator");
            }

            m_conflictType    = conflictType;
            m_conflictStatus  = conflictStatus;
            m_conflictDetails = conflictDetails;
            m_scopeHint       = scopeHint;
            m_translator      = translator;
        }