-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted to use AsyncPackage and updated autoload
Fixed #5
- Loading branch information
1 parent
903880e
commit f1102af
Showing
6 changed files
with
273 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,53 @@ | ||
using System; | ||
using System.ComponentModel.Design; | ||
using System.Runtime.InteropServices; | ||
using System.Threading; | ||
using Microsoft.VisualStudio.Shell; | ||
using Task = System.Threading.Tasks.Task; | ||
|
||
namespace BrowserReloadOnSave | ||
{ | ||
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] | ||
[PackageRegistration(UseManagedResourcesOnly = true)] | ||
[InstalledProductRegistration("#110", "#112", Vsix.Version, IconResourceID = 400)] | ||
[ProvideMenuResource("Menus.ctmenu", 1)] | ||
[ProvideOptionPage(typeof(Options), "Web", Vsix.Name, 101, 102, true, new string[0], ProvidesLocalizedCategoryName = false)] | ||
[ProvideAutoLoad("{349C5852-65DF-11dA-9384-00065B846F21}", PackageAutoLoadFlags.BackgroundLoad)] // WAP | ||
[ProvideAutoLoad("{E24C65DC-7377-472b-9ABA-BC803B73C61A}", PackageAutoLoadFlags.BackgroundLoad)] // WebSite | ||
[ProvideAutoLoad("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}", PackageAutoLoadFlags.BackgroundLoad)] // ProjectK | ||
[ProvideAutoLoad(ActivationContextGuid)] | ||
[ProvideUIContextRule(ActivationContextGuid, "Load Package", | ||
"WAP | WebSite | ProjectK | DotNetCoreWeb", | ||
new string[] { | ||
"WAP", | ||
"WebSite", | ||
"ProjectK", | ||
"DotNetCoreWeb" | ||
}, | ||
new string[] { | ||
"SolutionHasProjectFlavor:{349C5851-65DF-11DA-9384-00065B846F21}", | ||
"SolutionHasProjectFlavor:{E24C65DC-7377-472B-9ABA-BC803B73C61A}", | ||
"SolutionHasProjectFlavor:{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}", | ||
"SolutionHasProjectCapability:DotNetCoreWeb" | ||
})] | ||
[Guid(PackageGuids.guidBrowserReloadPackageString)] | ||
public sealed class VSPackage : Package | ||
public sealed class VSPackage : AsyncPackage | ||
{ | ||
private const string ActivationContextGuid = "{4b6c8d76-4918-45aa-9b26-8f246c1773aa}"; | ||
|
||
public static Options Options | ||
{ | ||
get; | ||
private set; | ||
} | ||
|
||
protected override void Initialize() | ||
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress) | ||
{ | ||
Logger.Initialize(Vsix.Name); | ||
|
||
Options = (Options)GetDialogPage(typeof(Options)); | ||
var commandService = await GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService; | ||
|
||
Logger.Initialize(this, Vsix.Name); | ||
EnableReloadCommand.Initialize(this); | ||
if (commandService != null) | ||
{ | ||
EnableReloadCommand.Initialize(this, commandService); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters