forked from killswitch1111/powerguivsx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPowerShellProjectPackage.cs
More file actions
73 lines (63 loc) · 3.01 KB
/
Copy pathPowerShellProjectPackage.cs
File metadata and controls
73 lines (63 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
using Microsoft.VisualStudio.ComponentModelHost;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudioTools.Project;
using PowerShellTools.Classification;
using PowerShellTools.Common;
using System;
using System.ComponentModel.Composition;
using System.Runtime.InteropServices;
namespace PowerShellTools.Project
{
[PackageRegistration(UseManagedResourcesOnly = true)]
[Guid(GuidList.PowerShellToolsProjectPackageGuid)]
[ProvideProjectFactory(typeof(PowerShellProjectFactory), "PowerShell", "PowerShell Project Files (*.pssproj);*.pssproj", "pssproj", "pssproj", @"\ProjectTemplates\PowerShell", LanguageVsTemplate = "PowerShell", NewProjectRequireNewFolderVsTemplate = false)]
[ProvideProjectItem(typeof(PowerShellProjectFactory), "PowerShell", @"Templates", 500)]
[ProvideEditorExtension(typeof(PowerShellEditorFactory), PowerShellConstants.PSD1File, 1000)]
[ProvideEditorExtension(typeof(PowerShellEditorFactory), PowerShellConstants.PS1File, 1000)]
[ProvideEditorExtension(typeof(PowerShellEditorFactory), PowerShellConstants.PSM1File, 1000)]
[ProvideEditorLogicalView(typeof(PowerShellEditorFactory), "{7651a702-06e5-11d1-8ebd-00a0c90f26ea}")] //LOGVIEWID_Designer
[ProvideEditorLogicalView(typeof(PowerShellEditorFactory), "{7651a701-06e5-11d1-8ebd-00a0c90f26ea}")] //LOGVIEWID_Code
[DeveloperActivity("PowerShell", typeof(PowerShellProjectPackage))]
[Export]
public class PowerShellProjectPackage : CommonProjectPackage
{
private readonly IDependencyValidator _validator;
public PowerShellProjectPackage()
{
var componentModel = (IComponentModel)GetGlobalService(typeof(SComponentModel));
_validator = (IDependencyValidator)componentModel.GetService<IDependencyValidator>();
UiContextUtilities.ActivateUiContext(UiContextUtilities.CreateUiContext(PowerShellTools.Common.Constants.PowerShellProjectUiContextGuid));
}
public override ProjectFactory CreateProjectFactory()
{
return new PowerShellProjectFactory(this, _validator.Validate());
}
public override CommonEditorFactory CreateEditorFactory()
{
return new PowerShellEditorFactory(this, _validator.Validate());
}
public override uint GetIconIdForAboutBox()
{
//TODO: GetIconIdForAboutBox
return 0;
}
public override uint GetIconIdForSplashScreen()
{
//TODO: GetIconIdFroSplashScreen
return 0;
}
public override string GetProductName()
{
return PowerShellConstants.LanguageName;
}
public override string GetProductDescription()
{
return PowerShellConstants.LanguageName;
}
public override string GetProductVersion()
{
return this.GetType().Assembly.GetName().Version.ToString();
}
}
}