AutoMerge.BranchesViewModel.GetLatest C# (CSharp) Méthode

GetLatest() private static méthode

private static GetLatest ( string targetPath, List mergeRelationships, Microsoft.TeamFoundation.VersionControl.Client.Workspace workspace ) : bool
targetPath string
mergeRelationships List
workspace Microsoft.TeamFoundation.VersionControl.Client.Workspace
Résultat bool
        private static bool GetLatest(string targetPath, List<MergeRelation> mergeRelationships, Workspace workspace)
        {
            var getLatestFiles = new List<string>();
            foreach (var mergeRelationship in mergeRelationships.Where(r => r.TargetItemType == ItemType.File && r.GetLatesPath != null))
            {
                if (mergeRelationship.GetLatesPath.StartsWith(targetPath))
                    getLatestFiles.Add(mergeRelationship.GetLatesPath);
            }

            var getLatestFilesArray = getLatestFiles.ToArray();
            if (getLatestFilesArray.Length > 0)
            {
                const RecursionType recursionType = RecursionType.None;
                var getLatestResult = workspace.Get(getLatestFilesArray, VersionSpec.Latest, recursionType, GetOptions.None);
                if (!getLatestResult.NoActionNeeded)
                {
                    // HACK.
                    getLatestResult = workspace.Get(getLatestFilesArray, VersionSpec.Latest, recursionType, GetOptions.None);
                    if (!getLatestResult.NoActionNeeded)
                    {
                        return false;
                    }
                }
            }

            return true;
        }