public override bool IsValidTypeForProject(IProjectStore projectStore) { if (!WindowsExecutableProjectType.IsSupportedOutputType(projectStore) || !WindowsExecutableProjectType.HasValidGuids(projectStore)) { return(false); } return(base.IsValidTypeForProject(projectStore)); }
private void PromptWithUnsupportedProjectDetails(IProjectStore projectStore, IProjectCreateError projectCreateError) { string invalidStoreUnsupportedError = StringTable.InvalidStoreUnsupportedError; string identifier = null; if (projectStore is InvalidProjectStore) { string safeExtension = Microsoft.Expression.Framework.Documents.PathHelper.GetSafeExtension(projectStore.DocumentReference.Path); if (!string.IsNullOrEmpty(safeExtension)) { identifier = string.Concat("DoNotWarnAboutExtension", safeExtension.ToUpperInvariant()); } } else if (projectCreateError != null) { invalidStoreUnsupportedError = projectCreateError.Message; identifier = projectCreateError.Identifier; } else if (projectStore.StoreVersion != CommonVersions.Version4_0) { CultureInfo currentUICulture = CultureInfo.CurrentUICulture; string invalidStoreBadToolsVersion = StringTable.InvalidStoreBadToolsVersion; object[] objArray = new object[] { "4.0" }; invalidStoreUnsupportedError = string.Format(currentUICulture, invalidStoreBadToolsVersion, objArray); identifier = "DoNotWarnAboutBadToolsVersion"; } else if (!ProjectStoreHelper.IsKnownLanguage(projectStore)) { invalidStoreUnsupportedError = StringTable.InvalidStoreUnknownLanguage; identifier = "DoNotWarnAboutUnknownLanguage"; } else if (!WindowsExecutableProjectType.IsSupportedOutputType(projectStore)) { invalidStoreUnsupportedError = StringTable.InvalidStoreUnsupportedOutputType; identifier = "DoNotWarnAboutUnsupportedOutputType"; } else if (ProjectStoreHelper.IsSketchFlowProject(projectStore)) { FrameworkName targetFrameworkName = ProjectStoreHelper.GetTargetFrameworkName(projectStore); if (targetFrameworkName == null || targetFrameworkName.Version != CommonVersions.Version4_0) { CultureInfo cultureInfo = CultureInfo.CurrentUICulture; string invalidStoreUnsupportedSketchflow = StringTable.InvalidStoreUnsupportedSketchflow; object[] objArray1 = new object[] { (targetFrameworkName.Identifier == "Silverlight" ? "Silverlight 4" : ".NET Framework 4.0") }; invalidStoreUnsupportedError = string.Format(cultureInfo, invalidStoreUnsupportedSketchflow, objArray1); identifier = "DoNotWarnAboutUnsupportedSketchflowProject"; } } CultureInfo currentUICulture1 = CultureInfo.CurrentUICulture; string unsupportedProjectWithDescription = StringTable.UnsupportedProjectWithDescription; object[] displayName = new object[] { projectStore.DocumentReference.DisplayName, invalidStoreUnsupportedError }; string str = string.Format(currentUICulture1, unsupportedProjectWithDescription, displayName); if (string.IsNullOrEmpty(identifier)) { this.Services.MessageDisplayService().ShowError(str); return; } IServiceProvider services = this.Services; MessageBoxArgs messageBoxArg = new MessageBoxArgs() { Button = MessageBoxButton.OK, Image = MessageBoxImage.Exclamation, Message = str, AutomationId = "UnsupportedProjectErrorDialog" }; services.ShowSuppressibleWarning(messageBoxArg, identifier, MessageBoxResult.OK); }