AGS.Types.BuildTargetsInfo.GetAvailableBuildTargetNames C# (CSharp) Method

GetAvailableBuildTargetNames() public static method

Returns a list of the names of all available build targets.
public static GetAvailableBuildTargetNames ( ) : string[]
return string[]
        public static string[] GetAvailableBuildTargetNames()
        {
            IList<IBuildTarget> targets = GetAvailableBuildTargets();
            string[] names = new string[targets.Count];
            for (int i = 0; i < targets.Count; ++i)
            {
                names[i] = targets[i].Name;
            }
            return names;
        }

Usage Example

Beispiel #1
0
        /// <summary>
        /// Helper function to validate the BuildTargets string. Excludes data file target
        /// from the string unless it is the only target, and optionally checks that the
        /// targets are available for building.
        /// </summary>
        private static string GetBuildTargetsString(string[] targets, bool checkAvailable)
        {
            if (targets.Length == 0)
            {
                return(BuildTargetsInfo.DATAFILE_TARGET_NAME);
            }
            List <string> availableTargets = null; // only retrieve available targets on request

            if (checkAvailable)
            {
                availableTargets = new List <string>(BuildTargetsInfo.GetAvailableBuildTargetNames());
            }
            List <string> resultTargetList = new List <string>(targets.Length);

            foreach (string targ in targets)
            {
                if ((!checkAvailable) || (availableTargets.Contains(targ)))
                {
                    // only include data file target if it is the only target
                    if ((targ != BuildTargetsInfo.DATAFILE_TARGET_NAME) || (targets.Length == 1))
                    {
                        resultTargetList.Add(targ);
                    }
                }
            }
            return(string.Join(BuildTargetUIEditor.Separators[0], resultTargetList.ToArray()));
        }
All Usage Examples Of AGS.Types.BuildTargetsInfo::GetAvailableBuildTargetNames