Skip to content

Commit 5aefc10

Browse files
Merge pull request #10 from MicrosoftDocs/master
new friends
2 parents 090f439 + cae102a commit 5aefc10

File tree

107 files changed

+1418
-1382
lines changed

Some content is hidden

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

107 files changed

+1418
-1382
lines changed

docs/code-quality/ca1063-implement-idisposable-correctly.md

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ ms.assetid: 12afb1ea-3a17-4a3f-a1f0-fcdb853e2359
1414
author: gewarren
1515
ms.author: gewarren
1616
manager: douge
17+
dev_langs:
18+
- "CSharp"
1719
ms.workload:
1820
- "multiple"
1921
---
@@ -28,51 +30,51 @@ ms.workload:
2830

2931
## Cause
3032

31-
`IDisposable` is not implemented correctly. Some reasons for this problem are listed here:
33+
The <xref:System.IDisposable?displayProperty=nameWithType> interface is not implemented correctly. Possible reasons for this include:
3234

33-
- IDisposable is re-implemented in the class.
35+
- <xref:System.IDisposable> is reimplemented in the class.
3436

35-
- Finalize is re-overridden.
37+
- Finalize is reoverridden.
3638

37-
- Dispose is overridden.
39+
- Dispose() is overridden.
3840

39-
- Dispose() is not public, sealed, or named Dispose.
41+
- The Dispose() method is not public, [sealed](/dotnet/csharp/language-reference/keywords/sealed), or named **Dispose**.
4042

4143
- Dispose(bool) is not protected, virtual, or unsealed.
4244

4345
- In unsealed types, Dispose() must call Dispose(true).
4446

45-
- For unsealed types, the Finalize implementation does not call either or both Dispose(bool) or the case class finalizer.
47+
- For unsealed types, the Finalize implementation does not call either or both Dispose(bool) or the base class finalizer.
4648

47-
Violation of any one of these patterns will trigger this warning.
49+
Violation of any one of these patterns triggers warning CA1063.
4850

49-
Every unsealed type that declares and implements the IDisposable interface must provide its own protected virtual void Dispose(bool) method. Dispose() should call Dipose(true) and Finalize should call Dispose(false). If you are creating an unsealed type that declares and implements the IDisposable interface, you must define Dispose(bool) and call it. For more information, see [Cleaning up unmanaged resources](/dotnet/standard/garbage-collection/unmanaged) in the [.NET Framework design guidelines](/dotnet/standard/design-guidelines/index).
51+
Every unsealed type that declares and implements the <xref:System.IDisposable> interface must provide its own protected virtual void Dispose(bool) method. Dispose() should call Dipose(true), and the finalizer should call Dispose(false). If you create an unsealed type that declares and implements the <xref:System.IDisposable> interface, you must define Dispose(bool) and call it. For more information, see [Clean up unmanaged resources (.NET guide)](/dotnet/standard/garbage-collection/unmanaged) and [Dispose pattern](/dotnet/standard/design-guidelines/dispose-pattern).
5052

5153
## Rule description
5254

53-
All IDisposable types should implement the Dispose pattern correctly.
55+
All <xref:System.IDisposable> types should implement the [Dispose pattern](/dotnet/standard/design-guidelines/dispose-pattern) correctly.
5456

5557
## How to fix violations
5658

57-
Examine your code and determine which of the following resolutions will fix this violation.
59+
Examine your code and determine which of the following resolutions will fix this violation:
5860

59-
- Remove IDisposable from the list of interfaces that are implemented by {0} and override the base class Dispose implementation instead.
61+
- Remove <xref:System.IDisposable> from the list of interfaces that are implemented by your type, and override the base class Dispose implementation instead.
6062

61-
- Remove the finalizer from type {0}, override Dispose(bool disposing), and put the finalization logic in the code path where 'disposing' is false.
63+
- Remove the finalizer from your type, override Dispose(bool disposing), and put the finalization logic in the code path where 'disposing' is false.
6264

63-
- Remove {0}, override Dispose(bool disposing), and put the dispose logic in the code path where 'disposing' is true.
65+
- Override Dispose(bool disposing), and put the dispose logic in the code path where 'disposing' is true.
6466

65-
- Ensure that {0} is declared as public and sealed.
67+
- Make sure that Dispose() is declared as public and [sealed](/dotnet/csharp/language-reference/keywords/sealed).
6668

67-
- Rename {0} to 'Dispose' and make sure that it is declared as public and sealed.
69+
- Rename your dispose method to **Dispose** and make sure that it's declared as public and [sealed](/dotnet/csharp/language-reference/keywords/sealed).
6870

69-
- Make sure that {0} is declared as protected, virtual, and unsealed.
71+
- Make sure that Dispose(bool) is declared as protected, virtual, and unsealed.
7072

71-
- Modify {0} so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in [!INCLUDE[vbprvb](../code-quality/includes/vbprvb_md.md)]), and then returns.
73+
- Modify Dispose() so that it calls Dispose(true), then calls <xref:System.GC.SuppressFinalize%2A> on the current object instance (`this`, or `Me` in Visual Basic), and then returns.
7274

73-
- Modify {0} so that it calls Dispose(false) and then returns.
75+
- Modify your finalizer so that it calls Dispose(false) and then returns.
7476

75-
- If you are creating an unsealed type that declares and implements the IDisposable interface, make sure that the implementation of IDisposable follows the pattern that is described earlier in this section.
77+
- If you create an unsealed type that declares and implements the <xref:System.IDisposable> interface, make sure that the implementation of <xref:System.IDisposable> follows the pattern that is described earlier in this section.
7678

7779
## When to suppress warnings
7880

@@ -96,7 +98,7 @@ public class Resource : IDisposable
9698
}
9799

98100
// NOTE: Leave out the finalizer altogether if this class doesn't
99-
// own unmanaged resources itself, but leave the other methods
101+
// own unmanaged resources, but leave the other methods
100102
// exactly as they are.
101103
~Resource()
102104
{
@@ -124,4 +126,9 @@ public class Resource : IDisposable
124126
}
125127
}
126128
}
127-
```
129+
```
130+
131+
## See also
132+
133+
- [Dispose pattern (framework design guidelines)](/dotnet/standard/design-guidelines/dispose-pattern)
134+
- [Clean up unmanaged resources (.NET guide)](/dotnet/standard/garbage-collection/unmanaged)

docs/designers/shader-designer-nodes.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ manager: douge
1111
ms.workload:
1212
- "multiple"
1313
---
14-
# Shader Designer Nodes
14+
# Shader Designer nodes
1515
The articles in this section of the documentation contain information about the various Shader Designer nodes that you can use to create graphics effects.
1616

1717
## Nodes and node types
18-
The Shader Designer represents visual effects as a graph. These graphs are built from nodes that are specifically chosen and connected in precise ways to achieve the intended affect. Each node represents either a piece of information or a mathematical function, and the connections between them represent how the information flows through the graph to produce the result. The Shader Designer provides six different node types—filters, texture nodes, parameters, constants, utility nodes, and math nodes—and several individual nodes belong to each type. These nodes and node types are described in the other articles in this sectionsee the links at the end of this document.
18+
The Shader Designer represents visual effects as a graph. These graphs are built from nodes that are specifically chosen and connected in precise ways to achieve the intended effect. Each node represents either a piece of information or a mathematical function, and the connections between them represent how the information flows through the graph to produce the result. The Shader Designer provides six different node types—filters, texture nodes, parameters, constants, utility nodes, and math nodes—and several individual nodes belong to each type. These nodes and node types are described in the other articles in this section. For more information, see the links at the end of this document.
1919

2020
## Node structure
2121
All nodes are made up of a combination of common elements. Every node has at least one output terminal on its right-hand side (except the final color node, which represents the output of the shader). Nodes that represent calculations or texture samplers have input terminals on their left-hand sides, but nodes that represent information have no input terminals. Output terminals are connected to input terminals to move information from one node to another.
@@ -39,9 +39,9 @@ The articles in this section of the documentation contain information about the
3939

4040
|Title|Description|
4141
|-----------|-----------------|
42-
|[Constant Nodes](../designers/constant-nodes.md)|Describes nodes that you can use to represent literal values and interpolated vertex-state information in shader calculations. Because vertex-state is interpolated—and therefore, is different for each pixel—each pixel-shader instance receives a different version of the constant.|
43-
|[Parameter Nodes](../designers/parameter-nodes.md)|Describes nodes that you can use to represent camera position, material properties, lighting parameters, time, and other app-state information in shader calculations.|
44-
|[Texture Nodes](../designers/texture-nodes.md)|Describes the nodes that you can use to sample various texture types and geometries, and to produce or transform texture coordinates in common ways.|
45-
|[Math Nodes](../designers/math-nodes.md)|Describes the nodes that you can use to perform algebraic, logic, trigonometric, and other mathematical operations that map directly to HLSL instructions.|
46-
|[Utility Nodes](../designers/utility-nodes.md)|Describes the nodes that you can use to perform common lighting calculations and other common operations that do not map directly to HLSL instructions.|
47-
|[Filter Nodes](../designers/filter-nodes.md)|Describes the nodes that you can use to perform texture filtering and color filtering.|
42+
|[Constant nodes](../designers/constant-nodes.md)|Describes nodes that you can use to represent literal values and interpolated vertex-state information in shader calculations. Because vertex-state is interpolated—and therefore, is different for each pixel—each pixel-shader instance receives a different version of the constant.|
43+
|[Parameter nodes](../designers/parameter-nodes.md)|Describes nodes that you can use to represent camera position, material properties, lighting parameters, time, and other app-state information in shader calculations.|
44+
|[Texture nodes](../designers/texture-nodes.md)|Describes the nodes that you can use to sample various texture types and geometries, and to produce or transform texture coordinates in common ways.|
45+
|[Math nodes](../designers/math-nodes.md)|Describes the nodes that you can use to perform algebraic, logic, trigonometric, and other mathematical operations that map directly to HLSL instructions.|
46+
|[Utility nodes](../designers/utility-nodes.md)|Describes the nodes that you can use to perform common lighting calculations and other common operations that do not map directly to HLSL instructions.|
47+
|[Filter nodes](../designers/filter-nodes.md)|Describes the nodes that you can use to perform texture filtering and color filtering.|

0 commit comments

Comments
 (0)