public static IEnumerable <Requirements> GetEffective([NotNull] this Requirements requirements)
        {
            #region Sanity checks
            if (requirements == null)
            {
                throw new ArgumentNullException("requirements");
            }
            #endregion

            var effectiveRequirements = requirements.Clone();
            effectiveRequirements.Command      = requirements.Command ?? (requirements.Architecture.Cpu == Cpu.Source ? Command.NameCompile : Command.NameRun);
            effectiveRequirements.Architecture = new Architecture(
                (effectiveRequirements.Architecture.OS == OS.All) ? Architecture.CurrentSystem.OS : effectiveRequirements.Architecture.OS,
                (effectiveRequirements.Architecture.Cpu == Cpu.All) ? Architecture.CurrentSystem.Cpu : effectiveRequirements.Architecture.Cpu);

            if (effectiveRequirements.Architecture.Cpu == Cpu.X64)
            { // x86-on-X64 compatability
                var x86Requirements = effectiveRequirements.Clone();
                x86Requirements.Architecture = new Architecture(x86Requirements.Architecture.OS, Cpu.I686);
                return(new[] { effectiveRequirements, x86Requirements });
            }
            else
            {
                return new[] { effectiveRequirements }
            };
        }
Beispiel #2
0
        private static Requirements GetEffectiveRequirements(Requirements requirements)
        {
            var effectiveRequirements = requirements.Clone();

            effectiveRequirements.Command = requirements.Command ?? (requirements.Architecture.Cpu == Cpu.Source ? Command.NameCompile : Command.NameRun);
            return(effectiveRequirements);
        }
Beispiel #3
0
        /// <summary>
        /// Creates a deep copy of this <see cref="AppEntry"/> instance.
        /// </summary>
        /// <returns>The new copy of the <see cref="AppEntry"/>.</returns>
        public AppEntry Clone()
        {
            var appList = new AppEntry {
                UnknownAttributes = UnknownAttributes, UnknownElements = UnknownElements, Name = Name, InterfaceUri = InterfaceUri
            };

            if (Requirements != null)
            {
                appList.Requirements = Requirements.Clone();
            }
            if (AccessPoints != null)
            {
                appList.AccessPoints = AccessPoints.Clone();
            }
            appList.CapabilityLists.AddRange(CapabilityLists.CloneElements());

            return(appList);
        }
 private static Requirements GetEffectiveRequirements(Requirements requirements)
 {
     var effectiveRequirements = requirements.Clone();
     effectiveRequirements.Command = requirements.Command ?? (requirements.Architecture.Cpu == Cpu.Source ? Command.NameCompile : Command.NameRun);
     return effectiveRequirements;
 }