Example #1
0
        /// <summary>
        /// Determines whether [is command required] [the specified nuget command].
        /// </summary>
        /// <param name="nugetCommand">The nuget command.</param>
        /// <param name="platform">The platform.</param>
        /// <returns>True or false.</returns>
        internal static bool IsCommandRequired(
            NugetCommand nugetCommand,
            string platform)
        {
            bool process = true;

            if (string.IsNullOrEmpty(nugetCommand.PlatForm) == false)
            {
                if (nugetCommand.PlatForm != platform)
                {
                    process = false;
                }
            }

            return(process);
        }
        /// <summary>
        /// Gets the nuget commands.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <returns>A list of nuget commands.</returns>
        internal IEnumerable <NugetCommand> GetNugetCommands(XElement element)
        {
            List <NugetCommand> nugetCommands = new List <NugetCommand>();

            IEnumerable <XElement> elements = element.Elements("NugetPackage");

            foreach (XElement nugetPackageElement in elements)
            {
                NugetCommand nugetCommand = new NugetCommand
                {
                    Command  = nugetPackageElement.Value,
                    PlatForm = nugetPackageElement.GetSafeAttributeStringValue("Platform")
                };

                nugetCommands.Add(nugetCommand);
            }

            return(nugetCommands);
        }
        /// <summary>
        /// Determines whether [is command required] [the specified nuget command].
        /// </summary>
        /// <param name="nugetCommand">The nuget command.</param>
        /// <param name="platform">The platform.</param>
        /// <returns>True or false.</returns>
        internal static bool IsCommandRequired(
            NugetCommand nugetCommand, 
            string platform)
        {
            bool process = true;

            if (string.IsNullOrEmpty(nugetCommand.PlatForm) == false)
            {
                if (nugetCommand.PlatForm != platform)
                {
                    process = false;
                }
            }

            return process;
        }