public override ConversionType GetVersion(ConversionTarget file) { if (!file.IsProject) { return(ConversionType.Unknown); } IProjectStore projectStore = file.ProjectStore; if (Microsoft.Expression.Framework.Interop.TypeHelper.ConvertType <bool>(projectStore.GetProperty("WindowsCEEnabled")) || Microsoft.Expression.Framework.Interop.TypeHelper.ConvertType <bool>(projectStore.GetProperty("SilverlightMobile"))) { return(ConversionType.Unsupported); } Version silverlightVersion = ProjectStoreHelper.GetSilverlightVersion(projectStore); if (silverlightVersion == CommonVersions.Version2_0) { return(ConversionType.ProjectSilverlight2); } if (silverlightVersion == CommonVersions.Version3_0) { return(ConversionType.ProjectSilverlight3); } if (silverlightVersion == CommonVersions.Version4_0) { return(ConversionType.ProjectSilverlight4); } return(ConversionType.Unknown); }
protected override bool UpgradeProject(IProjectStore projectStore, ConversionType initialVersion, ConversionType targetVersion) { if (targetVersion != ConversionType.BuildToolsVersion40) { return(false); } Version silverlightVersion = ProjectStoreHelper.GetSilverlightVersion(projectStore); if (silverlightVersion == null) { return(projectStore.SetStoreVersion(CommonVersions.Version4_0)); } return(SilverlightProjectConverter.ChangeImportPath(projectStore, silverlightVersion.ToString())); }