Datei: NDOPackage/NDOPackage.cs
Last Commit (946ad0e)
1 | // |
2 | // Copyright (c) 2002-2019 Mirko Matytschak |
3 | // (www.netdataobjects.de) |
4 | // |
5 | // Author: Mirko Matytschak |
6 | // |
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated |
8 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation |
9 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the |
10 | // Software, and to permit persons to whom the Software is furnished to do so, subject to the following |
11 | // conditions: |
12 | |
13 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions |
14 | // of the Software. |
15 | // |
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED |
17 | // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
18 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
19 | // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. |
21 | |
22 | global using Community.VisualStudio.Toolkit; |
23 | global using Microsoft.VisualStudio.Shell; |
24 | global using System; |
25 | global using Task = System.Threading.Tasks.Task; |
26 | using dte=EnvDTE; |
27 | using Microsoft.VisualStudio; |
28 | using Microsoft.VisualStudio.Shell.Interop; |
29 | using System.Runtime.InteropServices; |
30 | using System.Threading; |
31 | |
32 | namespace NDOVsPackage |
33 | { |
34 | ····[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] |
35 | ····[InstalledProductRegistration(Vsix.Name, Vsix.Description, Vsix.Version)] |
36 | ····[ProvideAutoLoad(UIContextGuids80.SolutionExists, PackageAutoLoadFlags.BackgroundLoad)] |
37 | ····[ProvideMenuResource("Menus.ctmenu", 1)] |
38 | ····[Guid(PackageGuids.NDOPackageString)] |
39 | ····public sealed class NDOPackage : ToolkitPackage |
40 | ····{ |
41 | ········protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress) |
42 | ········{ |
43 | ············await this.RegisterCommandsAsync(); |
44 | ············await JoinableTaskFactory.SwitchToMainThreadAsync(); |
45 | var dte = ( dte. _DTE) this. GetService( typeof( dte. _DTE) ) ; |
46 | ············ApplicationObject.VisualStudioApplication = dte; |
47 | ············this.buildEventHandler = new BuildEventHandler(); |
48 | ········} |
49 | ····} |
50 | } |
New Commit (33e9857)
1 | // |
2 | // Copyright (c) 2002-2019 Mirko Matytschak |
3 | // (www.netdataobjects.de) |
4 | // |
5 | // Author: Mirko Matytschak |
6 | // |
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated |
8 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation |
9 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the |
10 | // Software, and to permit persons to whom the Software is furnished to do so, subject to the following |
11 | // conditions: |
12 | |
13 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions |
14 | // of the Software. |
15 | // |
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED |
17 | // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
18 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
19 | // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. |
21 | |
22 | global using Community.VisualStudio.Toolkit; |
23 | global using Microsoft.VisualStudio.Shell; |
24 | global using System; |
25 | global using Task = System.Threading.Tasks.Task; |
26 | using dte=EnvDTE; |
27 | using Microsoft.VisualStudio.Shell.Interop; |
28 | using System.Runtime.InteropServices; |
29 | using System.Threading; |
30 | |
31 | namespace NDOVsPackage |
32 | { |
33 | ····[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] |
34 | ····[InstalledProductRegistration(Vsix.Name, Vsix.Description, Vsix.Version)] |
35 | ····[ProvideAutoLoad(UIContextGuids80.SolutionExists, PackageAutoLoadFlags.BackgroundLoad)] |
36 | ····[ProvideMenuResource("Menus.ctmenu", 1)] |
37 | ····[Guid(PackageGuids.NDOPackageString)] |
38 | ····public sealed class NDOPackage : ToolkitPackage |
39 | ····{ |
40 | ········BuildEventHandler buildEventHandler; |
41 | ········protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress) |
42 | ········{ |
43 | ············await this.RegisterCommandsAsync(); |
44 | ············await JoinableTaskFactory.SwitchToMainThreadAsync(); |
45 | var dte = ( dte. _DTE) await this. GetServiceAsync( typeof( dte. _DTE) ) ; |
46 | ············ApplicationObject.VisualStudioApplication = dte; |
47 | ············this.buildEventHandler = new BuildEventHandler(); |
48 | ········} |
49 | ····} |
50 | } |