Example #1
0
        /// <summary>
        /// Given a runtime version get the associated API Level version.
        /// </summary>
        /// <param name="version"></param>
        /// <returns></returns>
        public string GetAPILevel(string version)
        {
            string retVal = "";

            while (retVal == "")
            {
                if (APITargetListSingleton.Instance._tempAPITargetList != null)
                {
                    APITargetClass apiLevel = APITargetListSingleton.Instance._tempAPITargetList.FindLast(i => i.TargetVersion.Contains(version));

                    if (apiLevel != null)
                    {
                        retVal = apiLevel.TargetVersion;
                    }
                }

                if (retVal == "")
                {
                    int lastDot = version.LastIndexOf('.');
                    if (lastDot != -1)
                    {
                        version = version.Substring(0, lastDot);
                    }
                    else
                    {
                        break;
                    }
                }
            }

            return(retVal);
        }
Example #2
0
        /// <summary>
        /// Given a runtime version get the associated API Level version.
        /// </summary>
        /// <param name="version"></param>
        /// <returns></returns>
        public string GetDefaultLevel()
        {
            string retVal = "";

            if (APITargetListSingleton.Instance._tempAPITargetList != null)
            {
                APITargetClass apiLevel = APITargetListSingleton.Instance._tempAPITargetList.FindLast(i => i.IsDefault.Contains("True"));

                if (apiLevel != null)
                {
                    retVal = apiLevel.TargetVersion;
                }
            }

            return(retVal);
        }