Skip to content

Commit 6e2d64d

Browse files
authored
Merge pull request #2619 from LizCasey/v-elicas072618-extensibility
Content improvements for VS Extensibility articles, Task 1303377.
2 parents 3de40b7 + e8f7821 commit 6e2d64d

20 files changed

+239
-239
lines changed

docs/extensibility/verifying-subtypes-of-a-project-at-run-time.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ manager: douge
1515
ms.workload:
1616
- "vssdk"
1717
---
18-
# Verifying Subtypes of a Project at Run Time
18+
# Verify subtypes of a project at run time
1919
A VSPackage that depends on a custom project subtype should include logic to look for that subtype so that it can fail gracefully if the subtype is not present. The following procedure shows how to verify the presence of a specified subtype.
2020

2121
### To verify the presence of a subtype
2222

23-
1. Obtain the project hierarchy from the project and solution objects as a <xref:Microsoft.VisualStudio.Shell.Interop.IVsHierarchy> object by adding the following code to your VSPackage.
23+
1. Get the project hierarchy from the project and solution objects as a <xref:Microsoft.VisualStudio.Shell.Interop.IVsHierarchy> object by adding the following code to your VSPackage.
2424

25-
```
25+
```csharp
2626
EnvDTE.DTE dte;
2727
dte = (EnvDTE.DTE)Package.GetGlobalService(typeof(EnvDTE.DTE));
2828

@@ -39,22 +39,22 @@ A VSPackage that depends on a custom project subtype should include logic to loo
3939

4040
2. Cast the hierarchy to the <xref:Microsoft.VisualStudio.Shell.Flavor.IVsAggregatableProjectCorrected> interface.
4141

42-
```
42+
```csharp
4343
IVsAggregatableProjectCorrected AP;
4444
AP = hierarchy as IVsAggregatableProjectCorrected;
4545

4646
```
4747

4848
3. Get the list of project type GUIDs by invoking the <xref:Microsoft.VisualStudio.Shell.Flavor.IVsAggregatableProjectCorrected.GetAggregateProjectTypeGuids%2A>.
4949

50-
```
50+
```csharp
5151
string projTypeGuids = AP.GetAggregateProjectTypeGuids().ToUpper();
5252

5353
```
5454

5555
4. Check the list for the GUID of the specified subtype.
5656

57-
```
57+
```csharp
5858
// Replace the string "MyGUID" with the GUID of the subtype.
5959
string guidMySubtype = "MyGUID";
6060
if (projTypeGuids.IndexOf(guidMySubtype) > 0)
@@ -63,7 +63,7 @@ A VSPackage that depends on a custom project subtype should include logic to loo
6363
}
6464
```
6565

66-
## See Also
67-
[Project Subtypes](../extensibility/internals/project-subtypes.md)
68-
[Project Subtypes Design](../extensibility/internals/project-subtypes-design.md)
69-
[Properties and Methods Extended by Project Subtypes](../extensibility/internals/properties-and-methods-extended-by-project-subtypes.md)
66+
## See also
67+
[Project subtypes](../extensibility/internals/project-subtypes.md)
68+
[Project subtypes design](../extensibility/internals/project-subtypes-design.md)
69+
[Properties and methods extended by project subtypes](../extensibility/internals/properties-and-methods-extended-by-project-subtypes.md)

docs/extensibility/visibilityconstraints-element.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,49 +17,49 @@ manager: douge
1717
ms.workload:
1818
- "vssdk"
1919
---
20-
# VisibilityConstraints Element
20+
# VisibilityConstraints element
2121
The VisibilityConstraints element determines the static visibility of groups of commands and toolbars. The visibility is first controlled by the [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)] integrated development environment (IDE) without loading the VSPackage.
2222

2323
## Syntax
2424

25-
```
25+
```xml
2626
<VisibilityConstraints>
2727
<VisibilityConstraint>... </VisibilityConstraint>
2828
<VisibilityConstraint>... </VisibilityConstraint>
2929
</VisibilityConstraint>
3030
```
3131

32-
## Attributes and Elements
32+
## Attributes and elements
3333
The following sections describe attributes, child elements, and parent elements.
3434

3535
### Attributes
3636

3737
|Attribute|Description|
3838
|---------------|-----------------|
39-
|Condition|Optional. See [Conditional Attributes](../extensibility/vsct-xml-schema-conditional-attributes.md).|
39+
|Condition|Optional. See [Conditional attributes](../extensibility/vsct-xml-schema-conditional-attributes.md).|
4040

41-
### Child Elements
41+
### Child elements
4242

4343
|Element|Description|
4444
|-------------|-----------------|
45-
|[VisibilityItem Element](../extensibility/visibilityitem-element.md)|Determines the static visibility of commands and toolbars.|
45+
|[VisibilityItem element](../extensibility/visibilityitem-element.md)|Determines the static visibility of commands and toolbars.|
4646
|[VisibilityConstraints](../extensibility/visibilityconstraints-element.md)|Determines the static visibility of groups of commands and toolbars.|
4747

48-
### Parent Elements
48+
### Parent elements
4949

5050
|Element|Description|
5151
|-------------|-----------------|
52-
|[CommandTable Element](../extensibility/commandtable-element.md)|Defines all the elements that represent the commands (for example, menu items, menus, toolbars, and combo boxes) that a VSPackage provides to the IDE.|
52+
|[CommandTable element](../extensibility/commandtable-element.md)|Defines all the elements that represent the commands (for example, menu items, menus, toolbars, and combo boxes) that a VSPackage provides to the IDE.|
5353

5454
## Example
5555

56-
```
56+
```xml
5757
<VisibilityConstraints>
5858
  <VisibilityItem guid="cmdSetGuidMyProductCommands"     id="cmdidAddWidget"
5959
    context="guidNotViewSourceMode"/>
6060
</VisibilityConstraints>
6161
```
6262

63-
## See Also
64-
[VisibilityItem Element](../extensibility/visibilityitem-element.md)
65-
[Visual Studio Command Table (.Vsct) Files](../extensibility/internals/visual-studio-command-table-dot-vsct-files.md)
63+
## See also
64+
[VisibilityItem element](../extensibility/visibilityitem-element.md)
65+
[Visual Studio command table (.Vsct) files](../extensibility/internals/visual-studio-command-table-dot-vsct-files.md)

docs/extensibility/visibilityitem-element.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ manager: douge
1515
ms.workload:
1616
- "vssdk"
1717
---
18-
# VisibilityItem Element
18+
# VisibilityItem element
1919
The `VisibilityItem` element determines the static visibility of commands and toolbars. Every entry identifies a command or menu, and also an associated command UI context. Visual Studio detects commands, menus, and toolbars, and their visibility, without loading the VSPackages that define them. The IDE uses the <xref:Microsoft.VisualStudio.Shell.Interop.IVsMonitorSelection.IsCmdUIContextActive%2A> method to determine whether a command UI context is active.
2020

2121
After the VSPackage is loaded, Visual Studio expects command visibility to be determined by the VSPackage rather than the `VisibilityItem`. To determine your command's visibility, you can implement either the <xref:Microsoft.VisualStudio.Shell.OleMenuCommand.BeforeQueryStatus> event handler or the <xref:Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget.QueryStatus%2A> method, depending on how you have implemented your command.
@@ -26,14 +26,14 @@ The `VisibilityItem` element determines the static visibility of commands and to
2626

2727
## Syntax
2828

29-
```
29+
```xml
3030
<VisibilityItem
3131
guid ="="cmdGuidMyProductCommands"
3232
id=="cmdidAddWidget"
3333
context="guidNotViewSourceMode"/>
3434
```
3535
36-
## Attributes and Elements
36+
## Attributes and elements
3737
The following sections describe attributes, child elements, and parent elements.
3838
3939
### Attributes
@@ -43,34 +43,34 @@ The `VisibilityItem` element determines the static visibility of commands and to
4343
|guid|Required. The GUID of the GUID/ID command identifier.|
4444
|id|Required. The ID of the GUID/ID command identifier.|
4545
|context|Required. The UI context in which the command is visible.|
46-
|Condition|Optional. See [Conditional Attributes](../extensibility/vsct-xml-schema-conditional-attributes.md).|
46+
|Condition|Optional. See [Conditional attributes](../extensibility/vsct-xml-schema-conditional-attributes.md).|
4747
48-
### Child Elements
48+
### Child elements
4949
None
5050
51-
### Parent Elements
51+
### Parent elements
5252
5353
|Element|Description|
5454
|-------------|-----------------|
55-
|[VisibilityConstraints Element](../extensibility/visibilityconstraints-element.md)|The `VisibilityConstraints` element determines the static visibility of groups of commands and toolbars.|
55+
|[VisibilityConstraints element](../extensibility/visibilityconstraints-element.md)|The `VisibilityConstraints` element determines the static visibility of groups of commands and toolbars.|
5656
5757
## Remarks
5858
The standard Visual Studio UI contexts are defined in the *Visual Studio SDK installation path*\VisualStudioIntegration\Common\Inc\vsshlids.h file as well as in the <xref:Microsoft.VisualStudio.Shell.Interop.UIContextGuids> and <xref:Microsoft.VisualStudio.Shell.Interop.UIContextGuids80> classes. A more complete set of UI contexts is defined in the <xref:Microsoft.VisualStudio.VSConstants> class.
5959
6060
## Example
6161
62-
```
62+
```xml
6363
<VisibilityConstraints>
6464
  <VisibilityItem guid="cmdSetGuidMyProductCommands"     id="cmdidAddWidget"
6565
    context="guidNotViewSourceMode"/>
6666
</VisibilityConstraints>
6767
```
6868
69-
## See Also
69+
## See also
7070
<xref:Microsoft.VisualStudio.Shell.Interop.IVsMonitorSelection.IsCmdUIContextActive%2A>
7171
<xref:Microsoft.VisualStudio.Shell.OleMenuCommand.BeforeQueryStatus>
7272
<xref:Microsoft.VisualStudio.VSConstants>
7373
<xref:Microsoft.VisualStudio.Shell.Interop.UIContextGuids>
7474
<xref:Microsoft.VisualStudio.Shell.Interop.UIContextGuids80>
75-
[VisibilityConstraints Element](../extensibility/visibilityconstraints-element.md)
76-
[Visual Studio Command Table (.Vsct) Files](../extensibility/internals/visual-studio-command-table-dot-vsct-files.md)
75+
[VisibilityConstraints element](../extensibility/visibilityconstraints-element.md)
76+
[Visual Studio command table (.Vsct) Files](../extensibility/internals/visual-studio-command-table-dot-vsct-files.md)

0 commit comments

Comments
 (0)