Skip to content

Commit 0c27242

Browse files
authored
Merge pull request #664 from MicrosoftDocs/master
merge to live
2 parents feebe76 + 6706e6e commit 0c27242

File tree

1,183 files changed

+9377
-4330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,183 files changed

+9377
-4330
lines changed

docs/TOC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
# [Cross-Platform Mobile Development](cross-platform/cross-platform-mobile-development-in-visual-studio.md)
1414
# [Office and Sharepoint Development](vsto/office-and-sharepoint-development-in-visual-studio.md)
1515
# [Port, Migrate, and Upgrade Your Code](porting\port-migrate-and-upgrade-visual-studio-projects.md)
16-
# [Extensibility](extensibility/extensibility-in-visual-studio.md)
16+
# [Extensibility](extensibility/)
1717
# [Talk to Us](ide/talk-to-us.md)
1818
## [How to Report a Problem with Visual Studio 2017](ide/how-to-report-a-problem-with-visual-studio-2017.md)

docs/_breadcrumb/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
topicHref: /visualstudio/data-tools/accessing-data-in-visual-studio
1919
- name: Extensibility
2020
tocHref: /visualstudio/extensibility/
21-
topicHref: /visualstudio/extensibility/extensibility-in-visual-studio
21+
topicHref: /visualstudio/extensibility/
2222
items:
2323
- name: Inside the Visual Studio SDK
2424
tocHref: /visualstudio/extensibility/internals/

docs/code-quality/anonymous-methods-and-code-analysis.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ An *anonymous method* is a method that has no name. Anonymous methods are most f
4242

4343
For example, in the following class, any warnings that are found in the declaration of **anonymousMethod** should be raised against **Method1** and not **Method2**.
4444

45-
```vb#
45+
```vb
4646

4747
Delegate Function ADelegate(ByVal value As Integer) As Boolean
4848
Class AClass
@@ -55,7 +55,7 @@ Class AClass
5555
End SubEnd Class
5656
```
5757

58-
```c#
58+
```csharp
5959

6060
delegate void Delegate();
6161
class Class
@@ -81,7 +81,7 @@ class Class
8181

8282
For example, in the following class, any warnings that are found in the declaration of **anonymousMethod1** will be raised against the implicitly generated default constructor of **Class**. Whereas, those found in **anonymousMethod2** will be applied against the implicitly generated class constructor.
8383

84-
```vb#
84+
```vb
8585

8686
Delegate Function ADelegate(ByVal value As Integer) As BooleanClass AClass
8787
Dim anonymousMethod1 As ADelegate = Function(ByVal value As Integer) value > 5
@@ -93,7 +93,7 @@ Sub Method1()
9393
End SubEnd Class
9494
```
9595

96-
```c#
96+
```csharp
9797

9898
delegate void Delegate();
9999
class Class
@@ -120,7 +120,7 @@ class Class
120120

121121
For example, in the following class, any warnings that are found in the declaration of **anonymousMethod** should be raised against **Class(int)** and **Class(string)** but not against **Class()**.
122122

123-
```vb#
123+
```vb
124124

125125
Delegate Function ADelegate(ByVal value As Integer) As BooleanClass AClass
126126

@@ -134,7 +134,7 @@ End SubSub New(ByVal a As String)
134134
End SubEnd Class
135135
```
136136

137-
```c#
137+
```csharp
138138

139139
delegate void Delegate();
140140
class Class

docs/code-quality/ca1000-do-not-declare-static-members-on-generic-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ GenericType(Of Integer).SharedMethod()
5656
someObject.GenericMethod(Of Integer)()
5757
```
5858

59-
```c#
59+
```csharp
6060
// Static method in a generic type.
6161
GenericType<int>.StaticMethod();
6262

docs/code-quality/ca1013-overload-operator-equals-on-overloading-add-and-subtract.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Else
6363
End If
6464
```
6565

66-
```c#
66+
```csharp
6767
if (Object.ReferenceEquals(left, null))
6868
return Object.ReferenceEquals(right, null);
6969
return left.Equals(right);

docs/code-quality/ca1024-use-properties-where-appropriate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Namespace Microsoft.Samples
102102
End Namespace
103103
```
104104

105-
```c#
105+
```csharp
106106

107107
using System;
108108
using System.Diagnostics;

docs/code-quality/ca1058-types-should-not-extend-certain-base-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ translation.priority.ht:
7171

7272
**Examples of Incorrect Usage**
7373

74-
```c#
74+
```csharp
7575
public class MyCollection : CollectionBase
7676
{
7777
}
@@ -83,7 +83,7 @@ public class MyReadOnlyCollection : ReadOnlyCollectionBase
8383

8484
**Examples of Correct Usage**
8585

86-
```c#
86+
```csharp
8787
public class MyCollection : Collection<T>
8888
{
8989
}

docs/code-quality/ca1062-validate-arguments-of-public-methods.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ translation.priority.ht:
6060
## Example
6161
The following example shows a method that violates the rule and a method that satisfies the rule.
6262

63-
```cs
63+
```csharp
6464
using System;
6565

6666
namespace DesignLibrary
@@ -129,7 +129,7 @@ End Namespace
129129
## Example
130130
In [!INCLUDE[vsprvslong](../code-quality/includes/vsprvslong_md.md)], this rule does not detect that parameters are being passed to another method that does the validation.
131131

132-
```cs
132+
```csharp
133133
public string Method(string value)
134134
{
135135
EnsureNotNull(value);
@@ -165,7 +165,7 @@ End Sub
165165

166166
In the following `Person` class example, the `other` object that is passed to the `Person` copy constructor might be `null`.
167167

168-
```cs
168+
```csharp
169169
public class Person
170170
{
171171
    public string Name { get; private set; }
@@ -189,7 +189,7 @@ public class Person
189189
## Example
190190
In the following revised `Person` example, the `other` object that is passed to the copy constructor is first checked for null in the `PassThroughNonNull` method.
191191

192-
```cs
192+
```csharp
193193
public class Person
194194
{
195195
    public string Name { get; private set; }

docs/code-quality/ca1407-avoid-static-members-in-com-visible-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ translation.priority.mt:
5555

5656
For this rule to occur, an assembly-level <xref:System.Runtime.InteropServices.ComVisibleAttribute> must be set to `false` and the class- <xref:System.Runtime.InteropServices.ComVisibleAttribute> must be set to `true`, as the following code shows.
5757

58-
```c#
58+
```csharp
5959
using System;
6060
using System.Runtime.InteropServices;
6161

docs/code-quality/ca1812-avoid-uninstantiated-internal-classes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ translation.priority.mt:
8383

8484
- The class is passed as a generic type parameter that has a new constraint. For example, the following example will raise this rule.
8585

86-
```c#
86+
```csharp
8787
internal class MyClass
8888
{
8989
    public DoSomething()

docs/code-quality/ca1901-p-invoke-declarations-should-be-portable.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ translation.priority.mt:
6262
## Example
6363
The following example demonstrates a violation of this rule.
6464

65-
```c#
65+
```csharp
6666
internal class NativeMethods
6767
{
6868
    [DllImport("shell32.dll", CharSet=CharSet.Auto)]
@@ -73,15 +73,15 @@ internal class NativeMethods
7373

7474
In this example, the `nIconIndex` parameter is declared as an `IntPtr`, which is 4 bytes wide on a 32-bit platform and 8 bytes wide on a 64-bit platform. In the unmanaged declaration that follows, you can see that `nIconIndex` is a 4-byte unsigned integer on all platforms.
7575

76-
```c#
76+
```csharp
7777
HICON ExtractIcon(HINSTANCE hInst, LPCTSTR lpszExeFileName,
7878
    UINT nIconIndex);
7979
```
8080

8181
## Example
8282
To fix the violation, change the declaration to the following:
8383

84-
```c#
84+
```csharp
8585
internal class NativeMethods{
8686
    [DllImport("shell32.dll", CharSet=CharSet.Auto)] 
8787
    internal static extern IntPtr ExtractIcon(IntPtr hInst,

docs/code-quality/ca2000-dispose-objects-before-losing-scope.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ translation.priority.ht:
6262

6363
- Nesting constructors that are protected only by one exception handler. For example,
6464

65-
```cs
65+
```csharp
6666
using (StreamReader sr = new StreamReader(new FileStream("C:\myfile.txt", FileMode.Create)))
6767
{ ... }
6868
```
@@ -94,7 +94,7 @@ translation.priority.ht:
9494

9595
The `finally` block checks the value of `tempPort`. If it is not null, an operation in the method has failed, and `tempPort` is closed to make sure that any resources are released. The returned port object will contain the opened SerialPort object if the operations of the method succeeded, or it will be null if an operation failed.
9696

97-
```cs
97+
```csharp
9898
public SerialPort OpenPort1(string portName)
9999
{
100100
SerialPort port = new SerialPort(portName);

docs/code-quality/ca2151-fields-with-critical-types-should-be-security-critical.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ translation.priority.ht:
3939
## Cause
4040
A security transparent field or a safe critical field is declared. Its type is specified as security critical. For example:
4141

42-
```c#
42+
```csharp
4343
[assembly: AllowPartiallyTrustedCallers]
4444

4545
[SecurityCritical]
@@ -60,7 +60,7 @@ translation.priority.ht:
6060
## How to Fix Violations
6161
To fix a violation of this rule, mark the field with the <xref:System.Security.SecurityCriticalAttribute> attribute, or make the type that is referenced by the field eith security transparent or safe critical.
6262

63-
```c#
63+
```csharp
6464
// Fix 1: Make the referencing field security critical
6565
[assembly: AllowPartiallyTrustedCallers]
6666

docs/code-quality/ca2231-overload-operator-equals-on-overriding-valuetype-equals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Else
5959
End If
6060
```
6161

62-
```c#
62+
```csharp
6363
if (Object.ReferenceEquals(left, null))
6464
return Object.ReferenceEquals(right, null);
6565
return left.Equals(right);

docs/code-quality/ca3075-insecure-dtd-processing.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ translation.priority.mt:
8989

9090
### Violation
9191

92-
```c#
92+
```csharp
9393
using System.IO;
9494
using System.Xml.Schema;
9595

@@ -110,7 +110,7 @@ class TestClass
110110

111111
### Solution
112112

113-
```c#
113+
```csharp
114114
using System.IO;
115115
using System.Xml;
116116
using System.Xml.Schema;
@@ -133,7 +133,7 @@ class TestClass
133133

134134
### Violation
135135

136-
```c#
136+
```csharp
137137
using System.Xml;
138138

139139
namespace TestNamespace
@@ -151,7 +151,7 @@ namespace TestNamespace
151151

152152
### Solution
153153

154-
```c#
154+
```csharp
155155
using System.Xml;
156156

157157
namespace TestNamespace
@@ -173,7 +173,7 @@ namespace TestNamespace
173173

174174
### Violations
175175

176-
```c#
176+
```csharp
177177
using System.Xml;
178178

179179
namespace TestNamespace
@@ -189,7 +189,7 @@ namespace TestNamespace
189189
}
190190
```
191191

192-
```c#
192+
```csharp
193193
using System.Xml;
194194

195195
namespace TestNamespace
@@ -207,7 +207,7 @@ namespace TestNamespace
207207

208208
### Solution
209209

210-
```c#
210+
```csharp
211211
using System.Xml;
212212

213213
public static void TestMethod(string xml)
@@ -221,7 +221,7 @@ public static void TestMethod(string xml)
221221

222222
### Violation
223223

224-
```c#
224+
```csharp
225225
using System.IO;
226226
using System.Xml;
227227
using System.Xml.Serialization;
@@ -241,7 +241,7 @@ namespace TestNamespace
241241

242242
### Solution
243243

244-
```c#
244+
```csharp
245245
using System.IO;
246246
using System.Xml;
247247
using System.Xml.Serialization;
@@ -262,7 +262,7 @@ namespace TestNamespace
262262

263263
### Violation
264264

265-
```c#
265+
```csharp
266266
using System.Xml;
267267
using System.Xml.XPath;
268268

@@ -280,7 +280,7 @@ namespace TestNamespace
280280

281281
### Solution
282282

283-
```c#
283+
```csharp
284284
using System.Xml;
285285
using System.Xml.XPath;
286286

@@ -299,7 +299,7 @@ namespace TestNamespace
299299

300300
### Violation
301301

302-
```c#
302+
```csharp
303303
using System.Xml;
304304

305305
namespace TestNamespace
@@ -313,7 +313,7 @@ namespace TestNamespace
313313

314314
### Solution
315315

316-
```c#
316+
```csharp
317317
using System.Xml;
318318

319319
namespace TestNamespace
@@ -327,7 +327,7 @@ namespace TestNamespace
327327

328328
### Violations
329329

330-
```c#
330+
```csharp
331331
using System.Xml;
332332

333333
namespace TestNamespace
@@ -343,7 +343,7 @@ namespace TestNamespace
343343
}
344344
```
345345

346-
```c#
346+
```csharp
347347
using System.Xml;
348348

349349
namespace TestNamespace
@@ -358,7 +358,7 @@ namespace TestNamespace
358358
}
359359
```
360360

361-
```c#
361+
```csharp
362362
using System.Xml;
363363

364364
namespace TestNamespace
@@ -379,7 +379,7 @@ namespace TestNamespace
379379

380380
### Solution
381381

382-
```c#
382+
```csharp
383383
using System.Xml;
384384

385385
namespace TestNamespace

0 commit comments

Comments
 (0)