Skip to content

Commit ab3a7ae

Browse files
committed
Merge branch 'mikejo-exp2' of https://github.com/mikejo5000/visualstudio-docs-pr into mikejo-exp2
2 parents ad57ba4 + f9f499f commit ab3a7ae

File tree

178 files changed

+3869
-3836
lines changed

Some content is hidden

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

178 files changed

+3869
-3836
lines changed

docs/code-quality/C26426.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,24 @@ The order of execution of initializers for global objects may be inconsistent or
2525

2626
## Remarks
2727
- The rule ignores calls to constexpr functions or intrinsic functions on assumption that these either will be calculated at compile time or guarantee predictable execution at runtime.
28-
- Calls to inline functions are still flagged since the checker doesn’t attempt to analyze their implementation.
29-
- This rule can be quite noisy in many common scenarios where a variable of a user defined type (or standard container) is initialized globally: this is often due to calls to constructors and destructors. This is still a valid warning since it points to places where unpredictable behavior may exist or future changes in external code may introduce instability.
30-
- Static class members are considered global, so their initializers are also checked.
31-
## Example
32-
external version check
33-
// api.cpp
34-
int api_version = API_DEFAULT_VERSION; // Assume it can change at runtime, hence non-const.
35-
int get_api_version() noexcept {
28+
- Calls to inline functions are still flagged since the checker doesn’t attempt to analyze their implementation.
29+
- This rule can be quite noisy in many common scenarios where a variable of a user defined type (or standard container) is initialized globally: this is often due to calls to constructors and destructors. This is still a valid warning since it points to places where unpredictable behavior may exist or future changes in external code may introduce instability.
30+
- Static class members are considered global, so their initializers are also checked.
31+
32+
## Example
33+
external version check
34+
35+
```cpp
36+
// api.cpp
37+
int api_version = API_DEFAULT_VERSION; // Assume it can change at runtime, hence non-const.
38+
int get_api_version() noexcept {
3639
return api_version;
37-
}
40+
}
3841

3942
// client.cpp
4043
int get_api_version() noexcept;
4144
bool is_legacy_mode = get_api_version() <= API_LEGACY_VERSION; // C26426, also stale value
45+
```
4246

4347
## Example
4448
external version check – made more reliable

docs/code-quality/code-analysis-for-managed-code-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Frequently, it is useful to indicate that a warning is non-applicable. This info
4545
In-source suppression of warnings is implemented through custom attributes. To suppress a warning, add the attribute `SuppressMessage` to the source code as shown in the following example:
4646

4747
```csharp
48-
[System.Diagnosis.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1039:ListsAreStrongTyped")]
48+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1039:ListsAreStrongTyped")]
4949
Public class MyClass
5050
{
5151
// code

docs/code-quality/mixed-minimum-rules-rule-set.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The Microsoft Mixed Minimum Rules focus on the most critical problems in your C+
3131
|[C6270](../code-quality/c6270.md)|Missing Float Argument To Format Function|
3232
|[C6271](../code-quality/c6271.md)|Extra Argument To Format Function|
3333
|[C6272](../code-quality/c6272.md)|Non-Float Argument To Format Function|
34-
|[C6273](../code-quality/c6273.md)|Non-Integer Argumen To Format Function|
34+
|[C6273](../code-quality/c6273.md)|Non-Integer Argument To Format Function|
3535
|[C6274](../code-quality/c6274.md)|Non-Character Argument To Format Function|
3636
|[C6276](../code-quality/c6276.md)|Invalid String Cast|
3737
|[C6277](../code-quality/c6277.md)|Invalid CreateProcess Call|
@@ -90,7 +90,7 @@ The Microsoft Mixed Minimum Rules focus on the most critical problems in your C+
9090
|[C28215](../code-quality/c28215.md)|The typefix cannot be applied to a parameter that already has a typefix|
9191
|[C28216](../code-quality/c28216.md)|The checkReturn annotation only applies to postconditions for the specific function parameter.|
9292
|[C28217](../code-quality/c28217.md)|For function, the number of parameters to annotation does not match that found at file|
93-
|[C28218](../code-quality/c28218.md)|For function paramteer, the annotation's parameter does not match that found at file|
93+
|[C28218](../code-quality/c28218.md)|For function parameter, the annotation's parameter does not match that found at file|
9494
|[C28219](../code-quality/c28219.md)|Member of enumeration expected for annotation the parameter in the annotation|
9595
|[C28220](../code-quality/c28220.md)|Integer expression expected for annotation the parameter in the annotation|
9696
|[C28221](../code-quality/c28221.md)|String expression expected for the parameter in the annotation|

docs/code-quality/native-minimum-rules-rule-set.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The Microsoft Native Minimum Rules focus on the most critical problems in your n
3131
|[C6270](../code-quality/c6270.md)|Missing Float Argument To Format Function|
3232
|[C6271](../code-quality/c6271.md)|Extra Argument To Format Function|
3333
|[C6272](../code-quality/c6272.md)|Non-Float Argument To Format Function|
34-
|[C6273](../code-quality/c6273.md)|Non-Integer Argumen To Format Function|
34+
|[C6273](../code-quality/c6273.md)|Non-Integer Argument To Format Function|
3535
|[C6274](../code-quality/c6274.md)|Non-Character Argument To Format Function|
3636
|[C6276](../code-quality/c6276.md)|Invalid String Cast|
3737
|[C6277](../code-quality/c6277.md)|Invalid CreateProcess Call|
@@ -96,7 +96,7 @@ The Microsoft Native Minimum Rules focus on the most critical problems in your n
9696
|[C28215](../code-quality/c28215.md)|The typefix cannot be applied to a parameter that already has a typefix|
9797
|[C28216](../code-quality/c28216.md)|The checkReturn annotation only applies to postconditions for the specific function parameter.|
9898
|[C28217](../code-quality/c28217.md)|For function, the number of parameters to annotation does not match that found at file|
99-
|[C28218](../code-quality/c28218.md)|For function paramteer, the annotation's parameter does not match that found at file|
99+
|[C28218](../code-quality/c28218.md)|For function parameter, the annotation's parameter does not match that found at file|
100100
|[C28219](../code-quality/c28219.md)|Member of enumeration expected for annotation the parameter in the annotation|
101101
|[C28220](../code-quality/c28220.md)|Integer expression expected for annotation the parameter in the annotation|
102102
|[C28221](../code-quality/c28221.md)|String expression expected for the parameter in the annotation|

docs/data-tools/add-custom-controls-to-the-data-sources-window.md

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,53 +21,56 @@ ms.workload:
2121
- "data-storage"
2222
---
2323
# Add custom controls to the Data Sources window
24+
2425
When you drag an item from the **Data Sources** window to a design surface to create a data-bound control, you can select the type of control that you create. Each item in the window has a drop-down list that displays the controls that you can choose from. The set of controls associated with each item is determined by the data type of the item. If the control that you want to create does not appear in the list, you can follow the instructions in this topic to add the control to the list.
2526

26-
For more information about selecting data-bound controls to create for items in the **Data Sources** window, see [Set the control to be created when dragging from the Data Sources window](../data-tools/set-the-control-to-be-created-when-dragging-from-the-data-sources-window.md).
27+
For more information about selecting data-bound controls to create for items in the **Data Sources** window, see [Set the control to be created when dragging from the Data Sources window](../data-tools/set-the-control-to-be-created-when-dragging-from-the-data-sources-window.md).
28+
29+
## Customize the bindable controls list
2730

28-
> [!NOTE]
29-
> The dialog boxes and menu commands you see might differ from those described in Help, depending on your active settings or edition. To change your settings, on the **Tools** menu, select **Import and Export Settings**. For more information, see [Personalize the Visual Studio IDE](../ide/personalizing-the-visual-studio-ide.md).
31+
To add or remove controls from the list of available controls for items in the **Data Sources** window that have a specific data type, perform the following steps.
3032

31-
## <a name="customizinglist"></a> Customize the list of bindable controls for a data type
32-
To add or remove controls from the list of available controls for items in the **Data Sources** window that have a specific data type, perform the following steps.
33+
### To select the controls to be listed for a data type
3334

34-
#### To select the controls to be listed for a data type
35+
1. Make sure that the WPF Designer or the Windows Forms Designer is open.
3536

36-
1. Make sure that the WPF Designer or the Windows Forms Designer is open.
37+
2. In the **Data Sources** window, click an item that is part of a data source you added to the window, and then click the drop-down menu for the item.
3738

38-
2. In the **Data Sources** window, click an item that is part of a data source you added to the window, and then click the drop-down menu for the item.
39+
> [!TIP]
40+
> If the **Data Sources** window isn't open, open it by selecting **View** > **Other Windows** > **Data Sources**.
3941
40-
3. In the drop-down menu, click **Customize**. One of the following dialog boxes opens:
42+
3. In the drop-down menu, click **Customize**. One of the following dialog boxes opens:
4143

42-
- If the **Windows Forms Designer** is open, the **Data UI Customization** page of the **Options** dialog box opens.
44+
- If the **Windows Forms Designer** is open, the **Data UI Customization** page of the **Options** dialog box opens.
4345

44-
- If the **WPF Designer** is open, the **Customize Control Binding** dialog box opens.
46+
- If the **WPF Designer** is open, the **Customize Control Binding** dialog box opens.
4547

46-
4. In the dialog box, select a data type from the **Data type** drop-down list.
48+
4. In the dialog box, select a data type from the **Data type** drop-down list.
4749

48-
- To customize the list of controls for a table or object, select **[List]**.
50+
- To customize the list of controls for a table or object, select **[List]**.
4951

50-
- To customize the list of controls for a column of a table or a property of an object, select the data type of the column or property in the underlying data store.
52+
- To customize the list of controls for a column of a table or a property of an object, select the data type of the column or property in the underlying data store.
5153

52-
- To customize the list of controls to display data objects that have user-defined shapes, select **[Other]**. For example, select **[Other]** if your application has a custom control that displays data from more than one property of a particular object.
54+
- To customize the list of controls to display data objects that have user-defined shapes, select **[Other]**. For example, select **[Other]** if your application has a custom control that displays data from more than one property of a particular object.
5355

54-
5. In the **Associated controls** box, select each control that you want to be available for the selected data type, or clear the selection of any controls that you want to remove from the list.
56+
5. In the **Associated controls** box, select each control that you want to be available for the selected data type, or clear the selection of any controls that you want to remove from the list.
5557

5658
> [!NOTE]
57-
> If the control that you want to select does not appear in the **Associated controls** box, you must add the control to the list. For more information, see [Adding controls to the list of associated controls for a data type](#addingcontrols).
59+
> If the control that you want to select does not appear in the **Associated controls** box, you must add the control to the list. For more information, see [Add associated controls](#add-associated-controls).
5860
59-
6. Click **OK**.
61+
6. Click **OK**.
6062

61-
7. In the **Data Sources** window, click an item of the data type that you just associated one or more controls, and then click the drop-down menu for the item.
63+
7. In the **Data Sources** window, click an item of the data type that you just associated one or more controls, and then click the drop-down menu for the item.
6264

6365
The controls you selected in the **Associated controls** box now appear in the drop-down menu for the item.
6466

65-
## <a name="addingcontrols"></a> Add controls to the list of associated controls for a data type
66-
If you want to associate a control with a data type, but the control does not appear in the **Associated controls** box, you must add the control to the list. The control must be located in the current solution or in a referenced assembly. It must also be available in the **Toolbox** and have an attribute that specifies the control's data binding behavior.
67+
## Add associated controls
68+
69+
If you want to associate a control with a data type, but the control does not appear in the **Associated controls** box, you must add the control to the list. The control must be located in the current solution or in a referenced assembly. It must also be available in the **Toolbox** and have an attribute that specifies the control's data binding behavior.
6770

68-
#### To add controls to the list of associated controls
71+
### To add controls to the list of associated controls
6972

70-
1. Add the desired control to the **Toolbox** by right-clicking the **Toolbox** and selecting **Choose Items**.
73+
1. Add the desired control to the **Toolbox** by right-clicking the **Toolbox** and selecting **Choose Items**.
7174

7275
The control must have one of the following attributes.
7376

@@ -77,12 +80,12 @@ When you drag an item from the **Data Sources** window to a design surface to cr
7780
|<xref:System.ComponentModel.ComplexBindingPropertiesAttribute>|Implement this attribute on controls that display lists (or tables) of data, such as a <xref:System.Windows.Forms.DataGridView>.|
7881
|<xref:System.ComponentModel.LookupBindingPropertiesAttribute>|Implement this attribute on controls that display lists (or tables) of data, but also need to present a single column or property, such as a <xref:System.Windows.Forms.ComboBox>.|
7982

80-
2. For Windows Forms, on the **Options** dialog box, open the **Data UI Customization** page. Or, for WPF, open the **Customize Control Binding** dialog box. For more information, see [Customizing the list of bindable controls for a data type](#customizinglist).
83+
2. For Windows Forms, on the **Options** dialog box, open the **Data UI Customization** page. Or, for WPF, open the **Customize Control Binding** dialog box. For more information, see [Customize the list of bindable controls for a data type](#customize-the-bindable-controls-list).
8184

82-
3. In the **Associated controls** box, the control that you just added to the **Toolbox** should now appear.
85+
3. In the **Associated controls** box, the control that you just added to the **Toolbox** should now appear.
8386

8487
> [!NOTE]
85-
> Only controls that are located within the current solution or in a referenced assembly can be added to the list of associated controls. (The controls must also implement one of the data-binding attributes in the previous table.) To bind data to a custom control that is not available in the **Data Sources** window, drag the control from the **Toolbox** onto the design surface, and then drag the item to bind to from the **Data Sources** window onto the control.
88+
> Only controls that are located within the current solution or in a referenced assembly can be added to the list of associated controls. (The controls must also implement one of the data-binding attributes in the previous table.) To bind data to a custom control that is not available in the **Data Sources** window, drag the control from the **Toolbox** onto the design surface, and then drag the item to bind to from the **Data Sources** window onto the control.
8689
8790
## See also
8891

docs/data-tools/add-new-data-sources.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Add new data sources
3-
ms.date: 11/04/2016
3+
ms.date: 11/21/2018
44
ms.topic: conceptual
55
f1_keywords:
66
- "vs.datasource.datasourcefieldspicker"
@@ -18,7 +18,7 @@ ms.workload:
1818
---
1919
# Add new data sources
2020

21-
In the context of .NET data tools in Visual Studio, the term *data source* refers to .NET objects that connect to a data store and expose the data to a .NET application. The Visual Studio designers can consume the output of the data source to generate the boilerplate code that binds the data to forms when you drag and drop database objects from the **Data Sources** window. This kind of data source can be:
21+
In the context of .NET data tools in Visual Studio, the term *data source* refers to .NET objects that connect to a data store and make the data available to a .NET application. The Visual Studio designers can consume the output of the data source to generate the boilerplate code that binds the data to forms when you drag and drop database objects from the **Data Sources** window. This kind of data source can be:
2222

2323
- A class in an Entity Framework model that is associated with some kind of database.
2424

@@ -31,13 +31,22 @@ In the context of .NET data tools in Visual Studio, the term *data source* refer
3131
- A class or collection in your solution.
3232

3333
> [!NOTE]
34-
> If you are not using data-binding features, datasets, Entity Framework, LINQ to SQL, WCF, or SharePoint, the concept of a "data source" does not apply. Just connect directly to the database by using the SQLCommand objects and communicate directly with the database.
34+
> If you're not using data-binding features, datasets, Entity Framework, LINQ to SQL, WCF, or SharePoint, the concept of a "data source" does not apply. Just connect directly to the database by using the SQLCommand objects and communicate directly with the database.
3535
3636
You create and edit data sources by using the **Data Source Configuration Wizard** in a Windows Forms or Windows Presentation Foundation application. For Entity Framework, first create your entity classes, and then start the wizard by selecting **Project** > **Add New Data Source** (described in more detail later in this article).
3737

3838
![Data Source Configuration Wizard](../data-tools/media/data-source-configuration-wizard.png)
3939

40-
After you create a data source, it appears in the **Data Sources** tool window (**Shift**+**Alt**+**D** or **View** > **Other Windows** > **Data Source**). You can drag a data source from the **Data Sources** window onto a form design surface or control. This causes boilerplate code to be generated that displays the data from the data store. The following illustration shows a dataset that has been dropped onto a Windows form. If you select **F5** on the application, the data from the underlying database appears in the form's controls.
40+
## Data Sources window
41+
42+
After you create a data source, it appears in the **Data Sources** tool window.
43+
44+
> [!TIP]
45+
> To open the **Data Sources** window, make sure your project is open, and then press **Shift**+**Alt**+**D** or choose **View** > **Other Windows** > **Data Sources**.
46+
47+
You can drag a data source from the **Data Sources** window onto a form design surface or control. This causes boilerplate code to be generated that displays the data from the data store.
48+
49+
The following illustration shows a dataset that has been dropped onto a Windows form. If you select **F5** on the application, the data from the underlying database appears in the form's controls.
4150

4251
![Data Source drag operation](../data-tools/media/raddata-data-source-drag-operation.png)
4352

0 commit comments

Comments
 (0)