protected override void SetProjectPropertyInternal(SilverlightProject project, bool newValue) { ISolution solution = ProjectCommandExtensions.Solution((IProjectCommand)this); if (solution == null || project == null) { return; } solution.SolutionSettingsManager.SetProjectProperty((INamedProject)project, EnablePreviewOutOfBrowserCommand.PreviewOutOfBrowserEnabled, (object)(bool)(newValue ? true : false)); }
protected override object GetProjectPropertyInternal(SilverlightProject project) { ISolution solution = ProjectCommandExtensions.Solution((IProjectCommand)this); if (solution != null && project != null) { object projectProperty = solution.SolutionSettingsManager.GetProjectProperty((INamedProject)project, EnablePreviewOutOfBrowserCommand.PreviewOutOfBrowserEnabled); if (projectProperty != null && projectProperty is bool) { return((object)(bool)((bool)projectProperty ? true : false)); } } return((object)false); }
public override void Execute() { if (!this.IsEnabled) { return; } foreach (IDocumentItem documentItem in Enumerable.ToList <IDocumentItem>(ProjectCommandExtensions.Selection((IProjectCommand)this))) { IProjectItem projectItem = documentItem as IProjectItem; if (projectItem != null) { projectItem.OpenView(true); } } }
protected override bool CreateProjectItem() { IProject project = this.targetedProject != null ? this.targetedProject : ProjectCommandExtensions.SelectedProjectOrNull((IProjectCommand)this); if (project == null) { return(false); } bool flag = false; string[] filesToImport = this.GetFilesToImport(this.importedPathFilter != null ? this.importedPathFilter : this.GetImportFolder()); if (filesToImport != null && filesToImport.Length > 0) { foreach (string str in filesToImport) { string withoutExtension = Path.GetFileNameWithoutExtension(str); ProjectAssembly projectAssembly = project.ReferencedAssemblies.Find(withoutExtension); if (projectAssembly != null && !projectAssembly.IsImplicitlyResolved) { ProjectCommandExtensions.DisplayCommandFailedMessage((IProjectCommand)this, string.Format((IFormatProvider)CultureInfo.CurrentUICulture, StringTable.ReferenceExistsErrorDialogMessage, new object[2] { (object)str, (object)withoutExtension })); } else { IProjectItem projectItem = project.AddAssemblyReference(str, true); if (projectItem != null) { ProjectCommandExtensions.ProjectManager((IProjectCommand)this).DefaultImportPath = Path.GetDirectoryName(str); ProjectCommandExtensions.ProjectManager((IProjectCommand)this).ItemSelectionSet.Clear(); ProjectCommandExtensions.ProjectManager((IProjectCommand)this).ItemSelectionSet.ToggleSelection((IDocumentItem)projectItem); } ProjectXamlContext projectContext = ProjectXamlContext.GetProjectContext(project); if (projectContext != null) { projectContext.EnsureAssemblyReferenced(str); } if (projectItem != null) { flag = true; } } } } return(flag); }
protected override void SetProjectPropertyInternal(SilverlightProject project, bool newValue) { if (this.ShouldEnforceMutualExclusion() && newValue && project.EnableOutOfBrowser) { if (!this.PromptForPreviewOutOfBrowserToggle()) { return; } project.EnableOutOfBrowser = false; project.UsePlatformExtensions = true; ISolution solution = ProjectCommandExtensions.Solution((IProjectCommand)this); if (solution == null) { return; } solution.SolutionSettingsManager.SetProjectProperty((INamedProject)project, EnablePlatformExtensionsCommand.PreviewOutOfBrowserEnabled, (object)false); } else { project.UsePlatformExtensions = newValue; } }
protected SilverlightProject GetCurrentProject() { return(ProjectCommandExtensions.SelectedProjectOrNull((IProjectCommand)this) as SilverlightProject); }