Datei: NDOPackage/Commands/Configure.cs

Last Commit (946ad0e)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1 namespace NDOVsPackage.Commands
2 {
3 ····[Command(PackageGuids.guidNDOPackageCmdSetString, PackageIds.cmdidNDOConfiguration)]
4 ····internal sealed class Configure : BaseCommand<Configure>
5 ····{
6 ········protected override async Task ExecuteAsync(OleMenuCmdEventArgs e)
 
 
7 ········{
8 await VS. MessageBox. ShowWarningAsync( "Configure", "Button clicked") ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9 ········}
10
11 ········protected override void BeforeQueryStatus(EventArgs e)
12 ········{
13 ············Command.Visible = true;
14 ········}
15 ····}
16 }
17
New Commit (33e9857)
1 //
2 // Copyright (c) 2002-2022 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 using System.Diagnostics;
23 using MessageBox = System.Windows.Forms.MessageBox;
24
25 namespace NDOVsPackage.Commands
26 {
27 ····[Command(PackageGuids.guidNDOPackageCmdSetString, PackageIds.cmdidNDOConfiguration)]
28 ····internal sealed class Configure : BaseCommand<Configure>
29 ····{
30 ········protected override async Task ExecuteAsync(OleMenuCmdEventArgs e)
31 ········{
32 ············try
33 ············{
34 var project = await VS. Solutions. GetActiveProjectAsync( ) ;
35 ················await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
36 ················
37 ················if (project != null)
38 ················{
39 ····················try
40 ····················{
41 ························ProjectDescription pd = new ProjectDescription( project );
42 ························ConfigurationDialog dlg = new ConfigurationDialog( project.DteProject(), pd );
43 ························dlg.ShowDialog();
44 ····················}
45 ····················catch (Exception ex)
46 ····················{
47 ························Debug.WriteLine( ex.ToString() );
48 ························MessageBox.Show( ex.Message, "NDO Configuration" );
49 ····················}
50 ················}
51 ············}
52 ············catch (Exception ex)
53 ············{
54 ················Debug.WriteLine( ex.ToString() );
55 ················MessageBox.Show( ex.Message, "Configure" );
56 ············}
57 ········}
58
59 ········protected override void BeforeQueryStatus(EventArgs e)
60 ········{
61 ············Command.Visible = true;
62 ········}
63 ····}
64 }
65