Skip to content

Commit b6dfa1b

Browse files
authored
Merge pull request #3050 from MicrosoftDocs/master
10/8 AM Publish
2 parents 56f3c31 + e3c7344 commit b6dfa1b

24 files changed

+247
-198
lines changed

docs/ai/installation.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Installing AI Tools for Visual Studio
3-
description: Installation of AI Tools for Visual Studio
2+
title: Install AI Tools
3+
description: Describes how to install AI Tools for Visual Studio
44
keywords: ai, visual studio
55
author: lisawong19
66
ms.author: liwong
@@ -21,19 +21,20 @@ Visual Studio Tools for AI can be installed on Windows 64-bit operating systems.
2121

2222
This extension works with Visual Studio 2015 and Visual Studio 2017, Community edition or higher.
2323

24-
To install, download from the [Visual Studio Marketplace](http://aka.ms/vstoolsforai) or from within Visual Studio
24+
You can download the tools from the [Visual Studio Marketplace](http://aka.ms/vstoolsforai), or from within Visual Studio:
2525

26-
1. **Tools** > **Extensions and Updates**
26+
1. Select **Tools** > **Extensions and Updates**.
2727

28-
![install CUDA on Windows](media\installation\extensions.png)
28+
![Extensions and Updates menu in Visual Studio](media\installation\extensions.png)
2929

30-
1. **Search** in upper right-hand corner for "Tools for AI"
31-
2. Select **Visual Studio Tools for AI**
32-
3. Click **Download**
30+
2. In the **Extensions and Updates** dialog box, select **Online** on the left-hand side.
31+
3. In the search box in the upper right-hand corner, type or enter "tools for ai".
32+
4. Select **Visual Studio Tools for AI** from the results.
33+
5. Click **Download**.
3334

3435
## Prepare your local machine
3536

36-
Before training deep learning models on your local computer you should make sure you have the latest applicable prerequisites installed. This includes making sure the latest drivers and libraries for your NVIDIA GPU (if you have one). You should also ensure you have installed Python and Python libraries such as NumPy, SciPy, and appropriate deep learning frameworks such as Microsoft Cognitive Toolkit (CNTK), TensorFlow, Caffe2, MXNet, Keras, Theano, PyTorch and/or Chainer that you plan to use in your project.
37+
Before training deep learning models on your local computer, make sure you have the applicable prerequisites installed. This includes making sure you have the latest drivers and libraries for your NVIDIA GPU (if you have one). You should also ensure you've installed Python and Python libraries such as NumPy, SciPy, and appropriate deep learning frameworks such as Microsoft Cognitive Toolkit (CNTK), TensorFlow, Caffe2, MXNet, Keras, Theano, PyTorch, and Chainer, that you plan to use in your project.
3738

3839
> [!NOTE]
3940
> Software introduction in the following subsections is excerpted from their homepages.
@@ -44,17 +45,15 @@ Deep learning frameworks take advantage of NVIDIA GPU to let machines learn at a
4445

4546
### CUDA
4647

47-
[CUDA](https://developer.nvidia.com/cuda-zone) is a parallel computing platform and programming model invented by NVIDIA.
48-
It enables dramatic increases in computing performance by harnessing the power of the GPU.
49-
Currently, CUDA Toolkit 8.0 is required by deep learning frameworks.
48+
[CUDA](https://developer.nvidia.com/cuda-zone) is a parallel computing platform and programming model invented by NVIDIA. It enables dramatic increases in computing performance by harnessing the power of the GPU. Currently, CUDA Toolkit 8.0 is required by deep learning frameworks.
5049

5150
To install CUDA
5251

5352
- Visit this [site](https://developer.nvidia.com/cuda-80-ga2-download-archive), download CUDA and install it.
5453
- Make sure to install the CUDA runtime libraries, and then add CUDA binary path to the %PATH% or $Path environment variable.
5554
- On Windows, this path is "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin" by default.
5655

57-
![install CUDA on Windows](media\installation\install_cuda_win.png)
56+
![Install CUDA on Windows](media\installation\install_cuda_win.png)
5857

5958
### cuDNN
6059

@@ -80,7 +79,7 @@ Python has been the primary programming language for deep learning applications.
8079

8180
Deep learning frameworks rely on pip for their own installation.
8281

83-
![install Python on Windows](media\installation\install_python_win.png)
82+
![Install Python on Windows](media\installation\install_python_win.png)
8483

8584
Then, we need to verify whether Python 3.5 is installed correctly, and upgrade pip to the latest version by executing the following commands in a terminal:
8685

docs/extensibility/adding-a-submenu-to-a-menu.md

Lines changed: 136 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
title: "Adding a Submenu to a Menu | Microsoft Docs"
33
ms.custom: ""
44
ms.date: "11/04/2016"
5-
ms.technology:
5+
ms.technology:
66
- "vs-ide-sdk"
77
ms.topic: "conceptual"
8-
helpviewer_keywords:
8+
helpviewer_keywords:
99
- "context menus"
1010
- "submenus, cascading"
1111
- "cascading submenus"
@@ -14,143 +14,141 @@ ms.assetid: 692600cb-d052-40e2-bdae-4354ae7c6c84
1414
author: "gregvanl"
1515
ms.author: "gregvanl"
1616
manager: douge
17-
ms.workload:
17+
ms.workload:
1818
- "vssdk"
1919
---
2020
# Add a Submenu to a Menu
21-
This walkthrough builds on the demonstration in [Add a Menu to the Visual Studio Menu Bar](../extensibility/adding-a-menu-to-the-visual-studio-menu-bar.md) by showing how to add a submenu to the **TestMenu** menu.
22-
23-
A submenu is a secondary menu that appears in another menu. A submenu can be identified by the arrow that follows its name. Clicking the name causes the submenu and its commands to be displayed.
24-
25-
This walkthrough creates a submenu in a menu on the Visual Studio menu bar and puts a new command on the submenu. The walkthrough also implements the new command.
26-
27-
## Prerequisites
28-
Starting in Visual Studio 2015, you do not install the Visual Studio SDK from the download center. It is included as an optional feature in Visual Studio setup. You can also install the VS SDK later on. For more information, see [Install the Visual Studio SDK](../extensibility/installing-the-visual-studio-sdk.md).
29-
30-
## Add a Submenu to a Menu
31-
32-
1. Follow the steps in [Add a Menu to the Visual Studio Menu Bar](../extensibility/adding-a-menu-to-the-visual-studio-menu-bar.md) to create the project and menu item. The steps in this walkthrough assume that the name of the VSIX project is `TopLevelMenu`.
33-
34-
2. Open *TestCommandPackage.vsct*. In the `<Symbols>` section, add an `<IDSymbol>` element for the submenu, one for the submenu group, and one for the command, all in the `<GuidSymbol>` node named "guidTopLevelMenuCmdSet." This is the same node that contains the `<IDSymbol>` element for the top-level menu.
35-
36-
```xml
37-
<IDSymbol name="SubMenu" value="0x1100"/>
38-
<IDSymbol name="SubMenuGroup" value="0x1150"/>
39-
<IDSymbol name="cmdidTestSubCommand" value="0x0105"/>
40-
```
41-
42-
3. Add the newly created submenu to the `<Menus>` section.
43-
44-
```xml
45-
<Menu guid="guidTestCommandPackageCmdSet" id="SubMenu" priority="0x0100" type="Menu">
46-
<Parent guid="guidTestCommandPackageCmdSet" id="MyMenuGroup"/>
47-
<Strings>
48-
<ButtonText>Sub Menu</ButtonText>
49-
<CommandName>Sub Menu</CommandName>
50-
</Strings>
51-
</Menu>
52-
```
53-
54-
The GUID/ID pair of the parent specifies the menu group that was generated in [Add a Menu to the Visual Studio Menu Bar](../extensibility/adding-a-menu-to-the-visual-studio-menu-bar.md), and is a child of the top-level menu.
55-
56-
4. Add the menu group defined in step 2 to the `<Groups>` section and make it a child of the submenu.
57-
58-
```xml
59-
<Group guid="guidTestCommandPackageCmdSet" id="SubMenuGroup" priority="0x0000">
60-
<Parent guid="guidTestCommandPackageCmdSet" id="SubMenu"/>
61-
</Group>
62-
```
63-
64-
5. Add a new `<Button>` element to the `<Buttons>` section to define the command created in step 2 as an item on the submenu.
65-
66-
```xml
67-
<Button guid="guidTestCommandPackageCmdSet" id="cmdidTestSubCommand" priority="0x0000" type="Button">
68-
<Parent guid="guidTestCommandPackageCmdSet" id="SubMenuGroup" />
69-
<Icon guid="guidImages" id="bmpPic2" />
70-
<Strings>
71-
<CommandName>cmdidTestSubCommand</CommandName>
72-
<ButtonText>Test Sub Command</ButtonText>
73-
</Strings>
74-
</Button>
75-
```
76-
77-
6. Build the solution and start debugging. You should see the experimental instance.
78-
79-
7. Click **TestMenu** to see a new submenu named **Sub Menu**. Click **Sub Menu** to open the submenu and see a new command, **Test Sub Command**. Notice that clicking **Test Sub Command** does nothing.
80-
81-
## Add a Command
82-
83-
1. Open *TestCommand.cs* and add the following command ID after the existing command ID.
84-
85-
```csharp
86-
public const int cmdidTestSubCmd = 0x105;
87-
```
88-
89-
2. Add the sub-command. Find the command constructor. Add the following lines just after the call to the `AddCommand` method.
90-
91-
```csharp
92-
CommandID subCommandID = new CommandID(CommandSet, cmdidTestSubCmd);
93-
MenuCommand subItem = new MenuCommand(
94-
new EventHandler(SubItemCallback), subCommandID);
95-
commandService.AddCommand(subItem);
96-
97-
```
98-
99-
The `SubItemCallback` command handler will be defined later. The constructor should now look like this:
100-
101-
```csharp
102-
private TestCommand(Package package)
103-
{
104-
if (package == null)
105-
{
106-
throw new ArgumentNullException("package");
107-
}
108-
109-
this.package = package;
110-
111-
OleMenuCommandService commandService = this.ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
112-
if (commandService != null)
113-
{
114-
var menuCommandID = new CommandID(CommandSet, CommandId);
115-
var menuItem = new MenuCommand(this.MenuItemCallback, menuCommandID);
116-
commandService.AddCommand(menuItem);
117-
CommandID subCommandID = new CommandID(CommandSet, cmdidTestSubCmd);
118-
MenuCommand subItem = new MenuCommand(
119-
new EventHandler(SubItemCallback), subCommandID);
120-
commandService.AddCommand(subItem);
121-
}
122-
```
123-
124-
3. Add `SubItemCallback()`. This is the method that is called when the new command in the submenu is clicked.
125-
126-
```csharp
127-
private void SubItemCallback(object sender, EventArgs e)
128-
{
129-
IVsUIShell uiShell = (IVsUIShell)this.ServiceProvider.GetService(
130-
typeof(SVsUIShell));
131-
Guid clsid = Guid.Empty;
132-
int result;
133-
uiShell.ShowMessageBox(
134-
0,
135-
ref clsid,
136-
"TestCommand",
137-
string.Format(CultureInfo.CurrentCulture,
138-
"Inside TestCommand.SubItemCallback()",
139-
this.ToString()),
140-
string.Empty,
141-
0,
142-
OLEMSGBUTTON.OLEMSGBUTTON_OK,
143-
OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
144-
OLEMSGICON.OLEMSGICON_INFO,
145-
0,
146-
out result);
147-
}
148-
```
149-
150-
4. Build the project and start debugging. The experimental instance should appear.
151-
152-
5. On the **TestMenu** menu, click **Sub Menu** and then click **Test Sub Command**. A message box should appear and display the text, "Test Command Inside TestCommand.SubItemCallback()".
153-
154-
## See also
155-
[Add a menu to the Visual Studio menu bar](../extensibility/adding-a-menu-to-the-visual-studio-menu-bar.md)
21+
This walkthrough builds on the demonstration in [Add a Menu to the Visual Studio Menu Bar](../extensibility/adding-a-menu-to-the-visual-studio-menu-bar.md) by showing how to add a submenu to the **TestMenu** menu.
22+
23+
A submenu is a secondary menu that appears in another menu. A submenu can be identified by the arrow that follows its name. Clicking the name causes the submenu and its commands to be displayed.
24+
25+
This walkthrough creates a submenu in a menu on the Visual Studio menu bar and puts a new command on the submenu. The walkthrough also implements the new command.
26+
27+
## Prerequisites
28+
Starting in Visual Studio 2015, you do not install the Visual Studio SDK from the download center. It is included as an optional feature in Visual Studio setup. You can also install the VS SDK later on. For more information, see [Install the Visual Studio SDK](../extensibility/installing-the-visual-studio-sdk.md).
29+
30+
## Add a Submenu to a Menu
31+
32+
1. Follow the steps in [Add a Menu to the Visual Studio Menu Bar](../extensibility/adding-a-menu-to-the-visual-studio-menu-bar.md) to create the project and menu item. The steps in this walkthrough assume that the name of the VSIX project is `TopLevelMenu`.
33+
34+
2. Open *TestCommandPackage.vsct*. In the `<Symbols>` section, add an `<IDSymbol>` element for the submenu, one for the submenu group, and one for the command, all in the `<GuidSymbol>` node named "guidTopLevelMenuCmdSet." This is the same node that contains the `<IDSymbol>` element for the top-level menu.
35+
36+
```xml
37+
<IDSymbol name="SubMenu" value="0x1100"/>
38+
<IDSymbol name="SubMenuGroup" value="0x1150"/>
39+
<IDSymbol name="cmdidTestSubCommand" value="0x0105"/>
40+
```
41+
42+
3. Add the newly created submenu to the `<Menus>` section.
43+
44+
```xml
45+
<Menu guid="guidTestCommandPackageCmdSet" id="SubMenu" priority="0x0100" type="Menu">
46+
<Parent guid="guidTestCommandPackageCmdSet" id="MyMenuGroup"/>
47+
<Strings>
48+
<ButtonText>Sub Menu</ButtonText>
49+
<CommandName>Sub Menu</CommandName>
50+
</Strings>
51+
</Menu>
52+
```
53+
54+
The GUID/ID pair of the parent specifies the menu group that was generated in [Add a Menu to the Visual Studio Menu Bar](../extensibility/adding-a-menu-to-the-visual-studio-menu-bar.md), and is a child of the top-level menu.
55+
56+
4. Add the menu group defined in step 2 to the `<Groups>` section and make it a child of the submenu.
57+
58+
```xml
59+
<Group guid="guidTestCommandPackageCmdSet" id="SubMenuGroup" priority="0x0000">
60+
<Parent guid="guidTestCommandPackageCmdSet" id="SubMenu"/>
61+
</Group>
62+
```
63+
64+
5. Add a new `<Button>` element to the `<Buttons>` section to define the command created in step 2 as an item on the submenu.
65+
66+
```xml
67+
<Button guid="guidTestCommandPackageCmdSet" id="cmdidTestSubCommand" priority="0x0000" type="Button">
68+
<Parent guid="guidTestCommandPackageCmdSet" id="SubMenuGroup" />
69+
<Icon guid="guidImages" id="bmpPic2" />
70+
<Strings>
71+
<CommandName>cmdidTestSubCommand</CommandName>
72+
<ButtonText>Test Sub Command</ButtonText>
73+
</Strings>
74+
</Button>
75+
```
76+
77+
6. Build the solution and start debugging. You should see the experimental instance.
78+
79+
7. Click **TestMenu** to see a new submenu named **Sub Menu**. Click **Sub Menu** to open the submenu and see a new command, **Test Sub Command**. Notice that clicking **Test Sub Command** does nothing.
80+
81+
## Add a Command
82+
83+
1. Open *TestCommand.cs* and add the following command ID after the existing command ID.
84+
85+
```csharp
86+
public const int cmdidTestSubCmd = 0x0105;
87+
```
88+
89+
2. Add the sub-command. Find the command constructor. Add the following lines just after the call to the `AddCommand` method.
90+
91+
```csharp
92+
CommandID subCommandID = new CommandID(CommandSet, cmdidTestSubCmd);
93+
MenuCommand subItem = new MenuCommand(new EventHandler(SubItemCallback), subCommandID);
94+
commandService.AddCommand(subItem);
95+
```
96+
97+
The `SubItemCallback` command handler will be defined later. The constructor should now look like this:
98+
99+
```csharp
100+
private TestCommand(Package package)
101+
{
102+
if (package == null)
103+
{
104+
throw new ArgumentNullException("package");
105+
}
106+
107+
this.package = package;
108+
109+
OleMenuCommandService commandService = this.ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
110+
if (commandService != null)
111+
{
112+
var menuCommandID = new CommandID(CommandSet, CommandId);
113+
var menuItem = new MenuCommand(this.MenuItemCallback, menuCommandID);
114+
commandService.AddCommand(menuItem);
115+
116+
CommandID subCommandID = new CommandID(CommandSet, cmdidTestSubCmd);
117+
MenuCommand subItem = new MenuCommand(new EventHandler(SubItemCallback), subCommandID);
118+
commandService.AddCommand(subItem);
119+
}
120+
}
121+
```
122+
123+
3. Add `SubItemCallback()`. This is the method that is called when the new command in the submenu is clicked.
124+
125+
```csharp
126+
private void SubItemCallback(object sender, EventArgs e)
127+
{
128+
IVsUIShell uiShell = (IVsUIShell)this.ServiceProvider.GetService(typeof(SVsUIShell));
129+
Guid clsid = Guid.Empty;
130+
int result;
131+
uiShell.ShowMessageBox(
132+
0,
133+
ref clsid,
134+
"TestCommand",
135+
string.Format(CultureInfo.CurrentCulture,
136+
"Inside TestCommand.SubItemCallback()",
137+
this.ToString()),
138+
string.Empty,
139+
0,
140+
OLEMSGBUTTON.OLEMSGBUTTON_OK,
141+
OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
142+
OLEMSGICON.OLEMSGICON_INFO,
143+
0,
144+
out result);
145+
}
146+
```
147+
148+
4. Build the project and start debugging. The experimental instance should appear.
149+
150+
5. On the **TestMenu** menu, click **Sub Menu** and then click **Test Sub Command**. A message box should appear and display the text, "Test Command Inside TestCommand.SubItemCallback()".
151+
152+
## See also
153+
[Add a menu to the Visual Studio menu bar](../extensibility/adding-a-menu-to-the-visual-studio-menu-bar.md)
156154
[Commands, menus, and toolbars](../extensibility/internals/commands-menus-and-toolbars.md)

0 commit comments

Comments
 (0)