Пример #1
0
        private List <ConflictTableData> PrepareConflictsTableData(string shortcutcommand, string shortcutScopeText, string shortcutKeysText)
        {
            // Convert text like "Text Editor" and "Ctrl+R, Ctrl+O" into objects representing the Scope and key bindings
            KeybindingScope scope = ShortcutQueryEngine.GetScopeByName(shortcutScopeText);
            IEnumerable <BindingSequence> shortcutChords = ShortcutQueryEngine.GetBindingSequencesFromBindingString(shortcutKeysText);

            List <ConflictTableData> conflictList = new List <ConflictTableData>();

            ThreadHelper.JoinableTaskFactory.Run(async() =>
            {
                // Fetch all the conflict data for the give nScope/Shortcut combination
                IEnumerable <BindingConflict> conflicts = await ShortcutQueryEngine.GetConflictsAsync(AllCommandsCache, scope, shortcutChords);

                // Put each conflict into the backing object to use on the UI display
                foreach (BindingConflict conflict in conflicts)
                {
                    // Handle all the conflicts for this conflict type
                    ConflictType conflictType = conflict.Type;

                    foreach (Tuple <CommandBinding, Command> binding in conflict.AffectedBindings)
                    {
                        conflictList.Add(new ConflictTableData
                        {
                            ConflictType = GetConflictTypeText(conflictType),
                            Command      = binding.Item2.CanonicalName,
                            Scope        = binding.Item1.Scope.Name,
                            Shortcut     = binding.Item1.OriginalDTEString
                        });
                    }
                }
            });
            return(conflictList);
        }
Пример #2
0
 public VCLabelCreationConflict(ConflictType conflictType, string message, string labelName)
     : base(conflictType,
            Status.Unresolved,
            message,
            labelName)
 {
 }
Пример #3
0
 public VCMissingItemConflict(ConflictType conflictType, string path)
     : base(conflictType,
            Status.Unresolved,
            string.Format("The item '{0}' does not exist on the system.", path),
            path)
 {
 }
Пример #4
0
        public static int GetConflictCost(ConflictType type)
        {
            switch (type.Id)
            {
            case 3:
            case 4:
            case 6:
                return(1500);

            case 1:
            case 2:
            case 7:
                return(2500);

            case 10:
            case 12:
                return(3500);

            case 8:
            case 9:
            case 11:
            case 13:
                return(4500);

            default:
                return(4500);
            }
        }
 public CCCheckinConflict(ConflictType conflictType, string message, string changeGroupId)
     : base(conflictType,
            Status.Unresolved,
            message,
            changeGroupId)
 {
 }
Пример #6
0
 public VCBranchParentNotFoundConflict(ConflictType conflictType, string path)
     : base(conflictType,
            Status.Unresolved,
            string.Format("The branch parent or merge contributor of '{0}' cannot be found", path),
            path)
 {
 }
 public TFSZeroCheckinConflict(ConflictType conflictType, string changeGroupName)
     : base(conflictType,
            Status.Unresolved,
            string.Format("All changes from change group '{0}' were ignored by the server", changeGroupName),
            changeGroupName)
 {
 }
 protected BookOrderLinePriceConflict(Guid id, Guid bookOrderId, ConflictType conflictType, Guid bookOrderLineId,
                                      decimal price, bool accepted, DateTime createdDateTime)
     : base(id, bookOrderId, conflictType, bookOrderLineId, accepted, createdDateTime)
 {
     Price         = price;
     ConflictValue = price.ToString(CultureInfo.InvariantCulture);
 }
Пример #9
0
 public TfsCheckinFailureConflict(ConflictType conflictType, string changeGroupName, string conflictDetails)
     : base(conflictType,
            Status.Unresolved,
            conflictDetails,
            changeGroupName)
 {
 }
Пример #10
0
 internal InsertValuesStmt(WithClause with
                           , bool isReplaceStmt
                           , ConflictType onConflict
                           , bool hasIntoKeyword
                           , Table table
                           , UnqualifiedColumnNames columns
                           , ValuesList valuesList
                           , string constraintName
                           , Assignments updateaAsignments
                           , Predicate updateWhere
                           , Comments comments)
     : this(with
            , isReplaceStmt
            , onConflict
            , hasIntoKeyword
            , table
            , columns
            , valuesList
            , null
            , constraintName
            , updateaAsignments
            , updateWhere
            , comments)
 {
 }
Пример #11
0
 internal InsertSelectStmt(WithClause with
                           , bool isReplaceStmt
                           , ConflictType onConflict
                           , bool hasIntoKeyword
                           , Table table
                           , UnqualifiedColumnNames columns
                           , IQuery query
                           , UnqualifiedColumnNames conflictColumns
                           , Assignments updateaAsignments
                           , Predicate updateWhere
                           , Comments comments)
     : this(with
            , isReplaceStmt
            , onConflict
            , hasIntoKeyword
            , table
            , columns
            , query
            , conflictColumns
            , null
            , updateaAsignments
            , updateWhere
            , comments)
 {
 }
Пример #12
0
        public static string GetConflictMessage(ConflictType type)
        {
            var    resourceLoader = new ResourceLoader();
            string conflictMessage;

            switch (type)
            {
            case ConflictType.None: return("");

            case ConflictType.BothNew:
                conflictMessage = resourceLoader.GetString("SyncConflictBothNew");
                break;

            case ConflictType.BothChanged:
                conflictMessage = resourceLoader.GetString("SyncConflictBothChanged");
                break;

            case ConflictType.LocalDelRemoteChange:
                conflictMessage = resourceLoader.GetString("SyncConflictLocalDel");
                break;

            case ConflictType.RemoteDelLocalChange:
                conflictMessage = resourceLoader.GetString("SyncConflictRemoteDel");
                break;

            default:
                conflictMessage = "Unknown";
                break;
            }
            return($"{resourceLoader.GetString("SyncConflictPrefix")} {conflictMessage}");
        }
 public CCAttrTypeNotFoundConflict(ConflictType conflictType, string message, string attributeTypeName)
     : base(conflictType,
            Status.Unresolved,
            message,
            attributeTypeName)
 {
 }
Пример #14
0
 private InsertValuesStmt(WithClause with
                          , bool isReplaceStmt
                          , ConflictType onConflict
                          , bool hasIntoKeyword
                          , Table table
                          , UnqualifiedColumnNames columns
                          , ValuesList valuesList
                          , UnqualifiedColumnNames conflictColumns
                          , string constraintName
                          , Assignments updateaAsignments
                          , Predicate updateWhere
                          , Comments comments)
 {
     this.Comments          = comments;
     this.With              = with;
     this.IsReplaceStmt     = isReplaceStmt;
     this.OnConflict        = onConflict;
     this.HasIntoKeyword    = hasIntoKeyword;
     this.Table             = table;
     this.Columns           = columns;
     this.ValuesList        = valuesList;
     this.ConflictColumns   = conflictColumns;
     this.ConstraintName    = constraintName;
     this.UpdateAssignments = updateaAsignments;
     this.UpdateWhere       = updateWhere;
     if (updateaAsignments == null && updateWhere != null)
     {
         throw new System.ArgumentException(
                   "UpdateaAsignments must be not null, if updateWhere is not null. ");
     }
 }
 public TfsCheckinConflict(ConflictType conflictType, string changeGroupName)
     : base(conflictType,
            Status.Unresolved,
            string.Format("Error occurred during the code review of change group '{0}'. Please check {0}.txt for detail.", changeGroupName),
            changeGroupName)
 {
 }
Пример #16
0
 public Conflict(String message, ConflictType conflictType, ClassRecord conflictingClass)
 {
     Message = message;
     ConflictType = conflictType;
     ConflictingClasses = new List<ClassRecord> { conflictingClass };
     CardsCount = 1;
 }
Пример #17
0
 public TFSDosShortNameConflict(ConflictType conflictType, string message, string changeGroupName)
     : base(conflictType,
            Status.Unresolved,
            message,
            changeGroupName)
 {
 }
Пример #18
0
        public static String GetConflictMessage(ConflictType type)
        {
            var    _resourceLoader = new ResourceLoader();
            string conflictMessage;

            switch (type)
            {
            case ConflictType.NONE: return("");

            case ConflictType.BOTHNEW:
                conflictMessage = _resourceLoader.GetString("SyncConflictBothNew");
                break;

            case ConflictType.BOTH_CHANGED:
                conflictMessage = _resourceLoader.GetString("SyncConflictBothChanged");
                break;

            case ConflictType.LOCALDEL_REMOTECHANGE:
                conflictMessage = _resourceLoader.GetString("SyncConflictLocalDel");
                break;

            case ConflictType.REMOTEDEL_LOCALCHANGE:
                conflictMessage = _resourceLoader.GetString("SyncConflictRemoteDel");
                break;

            default:
                conflictMessage = "Unknown";
                break;
            }
            return($"{_resourceLoader.GetString("SyncConflictPrefix")} {conflictMessage}");
        }
Пример #19
0
 public VCFilePropertyCreationConflict(ConflictType conflictType, string message, string filePropertyName)
     : base(conflictType,
            Status.Unresolved,
            message,
            filePropertyName)
 {
 }
Пример #20
0
 public VCContentConflict(ConflictType conflictType, ChangeGroup changeGroup, string conflictDetails, string actionPath)
     : base(conflictType,
            Status.Unresolved,
            conflictDetails,
            string.Format("{0};{1}", actionPath, changeGroup.Name))
 {
 }
 public UnhandledChangeTypeConflict(ConflictType conflictType, string changeType)
     : base(conflictType,
            Status.Unresolved,
            string.Format("ChangeType '{0}' is unrecognized.", changeType),
            changeType)
 {
 }
Пример #22
0
 public Conflict(string message, ConflictType conflictType, IEnumerable<ClassRecord> conflictingClasses)
 {
     Message = message;
     ConflictType = conflictType;
     ConflictingClasses = conflictingClasses;
     CardsCount = conflictingClasses.Count();
 }
 public TfsItemNotFoundConflict(ConflictType conflictType, string message, string path)
     : base(conflictType,
            Status.Unresolved,
            message,
            path)
 {
 }
 public VCPathNotMappedConflict(ConflictType conflictType, string path)
     : base(conflictType,
            Status.Unresolved,
            string.Format("'{0}' to be migrated is not mapped", path),
            path)
 {
 }
Пример #25
0
        public static bool InConflict(long challengerId, long subjectId, ConflictType type, out ConflictPairData foundPairModule)
        {
            foundPairModule = null;
            if (!Config.Instance.EnableConflict)
            {
                return(false);
            }

            if (Core.NexusDetected)
            {
                return(MySession.Static.Factions.AreFactionsEnemies(challengerId, subjectId) ||
                       MySession.Static.Factions.IsFactionWithPlayerEnemy(challengerId, subjectId) ||
                       MySession.Static.Factions.IsFactionWithPlayerEnemy(subjectId, challengerId));
            }
            var inConflict = false;

            foreach (var pair in ConflictPairs)
            {
                if (pair.ChallengerId + pair.SubjectId != challengerId + subjectId || pair.CurrentConflictType != type)
                {
                    continue;
                }
                inConflict      = pair.CurrentConflictState == ConflictState.Active;
                foundPairModule = pair;
            }

            return(inConflict);
        }
Пример #26
0
 public VCContentConflict(ConflictType conflictType, MigrationAction conflictAction, MigrationAction otherSideConflictAction)
     : base(conflictType,
            Status.Unresolved,
            otherSideConflictAction.ActionId.ToString(),
            string.Format("{0};{1}", conflictAction.Path, conflictAction.ChangeGroup.Name))
 {
     ConflictedChangeAction = conflictAction;
 }
Пример #27
0
 public static ConflictType AddConflictType(ConflictType conflictType)
 {
     using (var repo = new CRUDRepository <ConflictType>())
     {
         conflictType.IsMapped = false;
         return(repo.Add(conflictType));
     }
 }
Пример #28
0
 public VCInvalidLabelNameConflict(ConflictType conflictType, MigrationAction conflictAction, string message)
     : base(conflictType,
            Status.Unresolved,
            message,
            string.Empty)
 {
     ConflictedChangeAction = conflictAction;
 }
Пример #29
0
 public Conflict(String message, ConflictType conflictType, FullClassRecord conflictingClass)
 {
     Message            = message;
     ConflictType       = conflictType;
     ConflictingClasses = new List <FullClassRecord> {
         conflictingClass
     };
 }
Пример #30
0
 public ConflictInfo(string packageName, TableRow conflictingItem, ConflictType conflictType, string conflictReason, string explanation)
 {
     PackageName     = packageName;
     ConflictingItem = conflictingItem;
     ConflictType    = conflictType;
     ConflictReason  = conflictReason;
     Explanation     = explanation;
 }
Пример #31
0
 /// <summary>
 /// Register a conflict type to the manager
 /// </summary>
 /// <param name="type"></param>
 public void RegisterConflictType(Guid migrationSourceId, ConflictType type)
 {
     if (!m_conflictTypes.ContainsKey(type.ReferenceName))
     {
         m_conflictTypes.Add(type.ReferenceName, type);
         UpdateSourceSpecificConflictTypeRegistry(migrationSourceId, type);
     }
 }
Пример #32
0
 public VCInvalidPathConflict(ConflictType conflictType, MigrationAction conflictAction, string message, string path)
     : base(conflictType,
            Status.Unresolved,
            message,
            path)
 {
     ConflictedChangeAction = conflictAction;
 }
Пример #33
0
 /// <summary>
 /// create ElementConflictInfo
 /// </summary>
 /// <param name="type"></param>
 /// <param name="conflictPath"></param>
 /// <param name="context"></param>
 /// <param name="message"></param>
 /// <param name="exception"></param>
 protected ElementConflictInfo(SyncElementInfo syncElementInfo, ConflictType type, int conflictPath, string context, string message, Exception exception)
 {
     SyncElementInfo = syncElementInfo;
     Type = type;
     ConflictPath = conflictPath;
     Context = context;
     Message = message;
     Exception = exception;
 }
Пример #34
0
        internal Conflict(string key, string labelKey, string[] pks, 
			ConflictType type, ConflictState state, IGeometry shape,
			string updateUser, DateTime updateTime, string pkField)
        {
            this.key = key;
            this.pks = pks;
            this.type = type;
            this.state = state;
            this.updateUser = updateUser;
            this.updateTime = updateTime;
            this.shape = shape;
            this.resolved_label = ResolveLabel(labelKey,pks,updateUser,updateTime);
        }
Пример #35
0
        private void setup(ConflictType type, ArrayList conflicts)
        {
            if(conflicts == null || conflicts.Count < 1)
            {
                return;
            }

            // sort set
            conflicts.Sort(Conflict.LabelComparerInstance());

            string typename = null;

            switch(type)
            {
                case ConflictType.Delete_Update:
                    typename = "Delete/Update";
                    break;
                case ConflictType.Insert_Insert:
                    typename = "Insert/Insert";
                    break;
                case ConflictType.Insert_Update:
                    typename = "Insert/Update";
                    break;
                case ConflictType.Update_Delete:
                    typename = "Update/Delete";
                    break;
                case ConflictType.Update_Insert:
                    typename = "Update/Insert";
                    break;
                case ConflictType.Update_Update:
                    typename = "Update/Update";
                    break;
            }

            // add grp to tree
            TreeNode type_tn = new TreeNode(typename);
            this.conflictsTreeView.Nodes.Add(type_tn);

            // add set to tree
            for(IEnumerator enm = conflicts.GetEnumerator();enm.MoveNext();)
            {
                Conflict c = (Conflict)enm.Current;
                TreeNode tn = new TreeNode(c.ConflictLabel);
                tn.Tag = c;
                type_tn.Nodes.Add(tn);
            }
        }
Пример #36
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Conflict"/> class.
 /// </summary>
 /// <param name="conflictType">The type of the conflict.</param>
 internal Conflict(ConflictType conflictType)
     : base()
 {
     this.conflictType = conflictType;
 }
Пример #37
0
 public TreeFileData(string name, FileStatus fileStatus, ConflictType conflictType, StagedStatus stagedStatus)
     : base(name, fileStatus, stagedStatus)
 {
     _conflictType = conflictType;
 }
Пример #38
0
        private Conflict create(string key, string labelKey, string[] keys, IFeature feature, 
			ConflictType type, string updateUser, DateTime updateTime)
        {
            string[] pks = new string[keys.Length];
            string pkField = "";
            for(int i=0;i<keys.Length;i++)
            {
                int index = feature.Fields.FindField(keys[i]);
                if(index>-1)
                {
                    object val = feature.get_Value(index);
                    pkField = keys[i];
                    pks[i] = val==null?null:val.ToString();
                }
            }
            return new Conflict(key, labelKey, pks, type, ConflictState.Open, feature.ShapeCopy, updateUser, updateTime, pkField);
        }
Пример #39
0
 public FileConflictInfo(SyncFileInfo syncFileInfo, ConflictType type, int conflictPath, string context, string message, Exception exception)
     : base(syncFileInfo, type, conflictPath, context, message, exception)
 {
 }