Exemplo n.º 1
0
        public static FrameworkName GetTargetFrameworkName(IProjectStore projectStore)
        {
            if (projectStore == null)
            {
                return(null);
            }
            if (!ProjectStoreHelper.IsKnownLanguage(ProjectStoreHelper.GetProjectLanguage(projectStore)))
            {
                return(null);
            }
            string  property  = projectStore.GetProperty("TargetFrameworkIdentifier");
            string  str       = projectStore.GetProperty("TargetFrameworkVersion");
            string  property1 = projectStore.GetProperty("TargetFrameworkProfile");
            Version version30 = null;

            if (!string.IsNullOrEmpty(str))
            {
                char[] chrArray = new char[] { 'v' };
                if (!Version.TryParse(str.TrimStart(chrArray), out version30))
                {
                    version30 = null;
                }
            }
            if (projectStore.StoreVersion == CommonVersions.Version2_0 && version30 == CommonVersions.Version2_0 && ProjectStoreHelper.UsesWpf(projectStore))
            {
                version30 = CommonVersions.Version3_0;
            }
            if (string.IsNullOrEmpty(property) || property.Equals("Silverlight", StringComparison.OrdinalIgnoreCase))
            {
                Version silverlightVersion = ProjectStoreHelper.GetSilverlightVersion(projectStore);
                if (silverlightVersion != null)
                {
                    property  = "Silverlight";
                    version30 = silverlightVersion;
                }
                else
                {
                    property = ".NETFramework";
                }
            }
            if (version30 == null)
            {
                return(null);
            }
            return(ProjectStoreHelper.GenerateFrameworkName(property, version30, property1));
        }
Exemplo n.º 2
0
 public static bool UsesSilverlight(IProjectStore projectStore)
 {
     return(ProjectStoreHelper.GetSilverlightVersion(projectStore) != null);
 }