Exemplo n.º 1
0
        private static bool?IsOverwrite(ShouldOverwrite shouldOverwrite,
                                        List <ToolDescription> toolsToBeOverwritten,
                                        List <ReportOrViewSpec> existingReports,
                                        ToolInfo toolInfo)
        {
            if (toolsToBeOverwritten.Count > 0)
            {
                // There is one weird case where the toolsToBeOverwritten could come from differnt packageNames.
                //     We have already ensured they all have the same version number and same unique identifier. If there
                //     are different package names then they have installed incorrectly defined tools
                var    tool = toolsToBeOverwritten.First();
                string toolCollectionName    = tool.PackageName + @" v" + tool.PackageVersion;
                string toolCollectionVersion = tool.PackageVersion;

                return(shouldOverwrite(toolCollectionName, toolCollectionVersion, existingReports,
                                       toolInfo.PackageVersion, toolInfo.PackageName));
            }
            else if (existingReports.Count > 0)
            {
                return(shouldOverwrite(null, null, existingReports, toolInfo.PackageVersion, toolInfo.PackageName));
            }
            // No conflicts
            return(true);
        }
Exemplo n.º 2
0
        private static bool? IsOverwrite(ShouldOverwrite shouldOverwrite,
            List<ToolDescription> toolsToBeOverwritten,
            List<ReportOrViewSpec> existingReports,
            ToolInfo toolInfo)
        {
            if (toolsToBeOverwritten.Count > 0)
            {
                // There is one weird case where the toolsToBeOverwritten could come from differnt packageNames.
                //     We have already ensured they all have the same version number and same unique identifier. If there
                //     are different package names then they have installed incorrectly defined tools
                var tool = toolsToBeOverwritten.First();
                string toolCollectionName = tool.PackageName + " v" + tool.PackageVersion; // Not L10N
                string toolCollectionVersion = tool.PackageVersion;

                return shouldOverwrite(toolCollectionName, toolCollectionVersion, existingReports,
                                            toolInfo.PackageVersion, toolInfo.PackageName);
            }
            else if (existingReports.Count > 0)
            {
                return shouldOverwrite(null, null, existingReports, toolInfo.PackageVersion, toolInfo.PackageName);
            }
            // No conflicts
            return true;
        }