You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/csharp/programming-guide/generics/generics-and-reflection.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,15 +34,15 @@ Because the Common Language Runtime (CLR) has access to generic type information
34
34
|<xref:System.Type.DeclaringMethod%2A>|Returns the generic method that defined the current generic type parameter, or null if the type parameter was not defined by a generic method.|
35
35
|<xref:System.Type.MakeGenericType%2A>|Substitutes the elements of an array of types for the type parameters of the current generic type definition, and returns a <xref:System.Type> object representing the resulting constructed type.|
36
36
37
-
In addition, new members are added to the <xref:System.Reflection.MethodInfo> class to enable run-time information for generic methods. See the <xref:System.Reflection.MethodInfo.IsGenericMethod%2A> property remarks for a list of invariant conditions for terms used to reflect on generic methods.
37
+
In addition, members of the <xref:System.Reflection.MethodInfo> class enable run-time information for generic methods. See the <xref:System.Reflection.MethodBase.IsGenericMethod%2A> property remarks for a list of invariant conditions for terms used to reflect on generic methods.
38
38
39
39
|System.Reflection.MemberInfo Member Name|Description|
|<xref:System.Reflection.MethodInfo.IsGenericMethod%2A>|Returns true if a method is generic.|
41
+
|<xref:System.Reflection.MethodBase.IsGenericMethod%2A>|Returns true if a method is generic.|
42
42
|<xref:System.Reflection.MethodInfo.GetGenericArguments%2A>|Returns an array of Type objects that represent the type arguments of a constructed generic method or the type parameters of a generic method definition.|
43
43
|<xref:System.Reflection.MethodInfo.GetGenericMethodDefinition%2A>|Returns the underlying generic method definition for the current constructed method.|
44
-
|<xref:System.Reflection.MethodInfo.ContainsGenericParameters%2A>|Returns true if the method or any of its enclosing types contain any type parameters for which specific types have not been supplied.|
45
-
|<xref:System.Reflection.MethodInfo.IsGenericMethodDefinition%2A>|Returns true if the current <xref:System.Reflection.MethodInfo> represents the definition of a generic method.|
44
+
|<xref:System.Reflection.MethodBase.ContainsGenericParameters%2A>|Returns true if the method or any of its enclosing types contain any type parameters for which specific types have not been supplied.|
45
+
|<xref:System.Reflection.MethodBase.IsGenericMethodDefinition%2A>|Returns true if the current <xref:System.Reflection.MethodInfo> represents the definition of a generic method.|
46
46
|<xref:System.Reflection.MethodInfo.MakeGenericMethod%2A>|Substitutes the elements of an array of types for the type parameters of the current generic method definition, and returns a <xref:System.Reflection.MethodInfo> object representing the resulting constructed method.|
Copy file name to clipboardExpand all lines: docs/framework/reflection-and-codedom/reflection-and-generic-types.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,15 +62,15 @@ ms.workload:
62
62
63
63
<aname="is_this_a_generic_type_or_method"></a>
64
64
## Is This a Generic Type or Method?
65
-
When you use reflection to examine an unknown type, represented by an instance of <xref:System.Type>, use the <xref:System.Type.IsGenericType%2A> property to determine whether the unknown type is generic. It returns `true` if the type is generic. Similarly, when you examine an unknown method, represented by an instance of the <xref:System.Reflection.MethodInfo> class, use the <xref:System.Reflection.MethodInfo.IsGenericMethod%2A> property to determine whether the method is generic.
65
+
When you use reflection to examine an unknown type, represented by an instance of <xref:System.Type>, use the <xref:System.Type.IsGenericType%2A> property to determine whether the unknown type is generic. It returns `true` if the type is generic. Similarly, when you examine an unknown method, represented by an instance of the <xref:System.Reflection.MethodInfo> class, use the <xref:System.Reflection.MethodBase.IsGenericMethod%2A> property to determine whether the method is generic.
66
66
67
67
### Is This a Generic Type or Method Definition?
68
-
Use the <xref:System.Type.IsGenericTypeDefinition%2A> property to determine whether a <xref:System.Type> object represents a generic type definition, and use the <xref:System.Reflection.MethodInfo.IsGenericMethodDefinition%2A> method to determine whether a <xref:System.Reflection.MethodInfo> represents a generic method definition.
68
+
Use the <xref:System.Type.IsGenericTypeDefinition%2A> property to determine whether a <xref:System.Type> object represents a generic type definition, and use the <xref:System.Reflection.MethodBase.IsGenericMethodDefinition%2A> method to determine whether a <xref:System.Reflection.MethodInfo> represents a generic method definition.
69
69
70
70
Generic type and method definitions are the templates from which instantiable types are created. Generic types in the .NET Framework class library, such as <xref:System.Collections.Generic.Dictionary%602>, are generic type definitions.
71
71
72
72
### Is the Type or Method Open or Closed?
73
-
A generic type or method is closed if instantiable types have been substituted for all its type parameters, including all the type parameters of all enclosing types. You can only create an instance of a generic type if it is closed. The <xref:System.Type.ContainsGenericParameters%2A?displayProperty=nameWithType> property returns `true` if a type is open. For methods, the <xref:System.Reflection.MethodInfo.ContainsGenericParameters%2A?displayProperty=nameWithType> method performs the same function.
73
+
A generic type or method is closed if instantiable types have been substituted for all its type parameters, including all the type parameters of all enclosing types. You can only create an instance of a generic type if it is closed. The <xref:System.Type.ContainsGenericParameters%2A?displayProperty=nameWithType> property returns `true` if a type is open. For methods, the <xref:System.Reflection.MethodBase.ContainsGenericParameters%2A?displayProperty=nameWithType> method performs the same function.
74
74
75
75
[Back to top](#top)
76
76
@@ -146,7 +146,7 @@ generic<typename V, typename W> ref class D : B<int, V> {};
146
146
147
147
<a name="invariants"></a>
148
148
## Invariants
149
-
For a table of the invariant conditions for common terms in reflection for generic types, see <xref:System.Type.IsGenericType%2A?displayProperty=nameWithType>. For additional terms relating to generic methods, see <xref:System.Reflection.MethodInfo.IsGenericMethod%2A?displayProperty=nameWithType>.
149
+
For a table of the invariant conditions for common terms in reflection for generic types, see <xref:System.Type.IsGenericType%2A?displayProperty=nameWithType>. For additional terms relating to generic methods, see <xref:System.Reflection.MethodBase.IsGenericMethod%2A?displayProperty=nameWithType>.
Copy file name to clipboardExpand all lines: docs/framework/wpf/advanced/walkthrough-arranging-windows-forms-controls-in-wpf.md
+17-42Lines changed: 17 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,11 @@
1
1
---
2
2
title: "Walkthrough: Arranging Windows Forms Controls in WPF"
3
3
ms.custom: ""
4
-
ms.date: "03/30/2017"
4
+
ms.date: "04/03/2018"
5
5
ms.prod: ".net-framework"
6
-
ms.reviewer: ""
7
6
ms.suite: ""
8
7
ms.technology:
9
8
- "dotnet-wpf"
10
-
ms.tgt_pltfrm: ""
11
9
ms.topic: "article"
12
10
dev_langs:
13
11
- "csharp"
@@ -16,7 +14,6 @@ helpviewer_keywords:
16
14
- "hybrid applications [WPF interoperability]"
17
15
- "arranging controls [WPF]"
18
16
ms.assetid: a1db8049-15c7-45d6-ae3d-36a6735cb848
19
-
caps.latest.revision: 31
20
17
author: dotnet-bot
21
18
ms.author: dotnetcontent
22
19
manager: "wpickett"
@@ -158,24 +155,15 @@ This walkthrough shows you how to use [!INCLUDE[TLA2#tla_winclient](../../../../
158
155
5. Click the **Click me** button. The `button1_Click` event handler sets the <xref:System.Windows.Forms.Control.Top%2A> and <xref:System.Windows.Forms.Control.Left%2A> properties on the hosted control. This causes the hosted control to be repositioned within the <xref:System.Windows.Forms.Integration.WindowsFormsHost> element. The host maintains the same screen area, but the hosted control is clipped. Instead, the hosted control should always fill the <xref:System.Windows.Forms.Integration.WindowsFormsHost> element.
159
156
160
157
## Understanding Z-Order Limitations
161
-
By default, visible <xref:System.Windows.Forms.Integration.WindowsFormsHost> elements are always drawn on top of other [!INCLUDE[TLA2#tla_winclient](../../../../includes/tla2sharptla-winclient-md.md)] elements, and they are unaffected by z-order. To enable z-ordering, set the <xref:System.Windows.Interop.HwndHost.IsRedirected%2A> property of the <xref:System.Windows.Forms.Integration.WindowsFormsHost> to true and the <xref:System.Windows.Interop.HwndHost.CompositionMode%2A> property to <xref:System.Windows.Interop.CompositionMode.Full> or <xref:System.Windows.Interop.CompositionMode.OutputOnly>.
162
-
163
-
#### To see the default z-order behavior
164
-
165
-
1. Copy the following XAML into the <xref:System.Windows.Controls.Grid> element.
166
-
158
+
Visible <xref:System.Windows.Forms.Integration.WindowsFormsHost> elements are always drawn on top of other WPF elements, and they are unaffected by z-order. To see this z-order behavior, do the following:
159
+
160
+
1. Copy the following XAML into the <xref:System.Windows.Controls.Grid> element.
Press F5 to build and run the application. The label element is painted over the <xref:System.Windows.Forms.Integration.WindowsFormsHost> element.
178
-
165
+
166
+
179
167
## Docking
180
168
<xref:System.Windows.Forms.Integration.WindowsFormsHost> element supports [!INCLUDE[TLA2#tla_winclient](../../../../includes/tla2sharptla-winclient-md.md)] docking. Set the <xref:System.Windows.Controls.DockPanel.Dock%2A> attached property to dock the hosted control in a <xref:System.Windows.Controls.DockPanel> element.
181
169
@@ -219,43 +207,30 @@ This walkthrough shows you how to use [!INCLUDE[TLA2#tla_winclient](../../../../
219
207
2. Press F5 to build and run the application. The <xref:System.Windows.Forms.Integration.WindowsFormsHost> element is centered in the grid row, but it is not stretched to fill the available space. If the window is large enough, you may see two or more months displayed by the hosted <xref:System.Windows.Forms.MonthCalendar> control, but these are centered in the row. The [!INCLUDE[TLA2#tla_winclient](../../../../includes/tla2sharptla-winclient-md.md)] layout engine centers elements that cannot be sized to fill the available space.
220
208
221
209
## Scaling
222
-
Unlike [!INCLUDE[TLA2#tla_winclient](../../../../includes/tla2sharptla-winclient-md.md)] elements, most [!INCLUDE[TLA#tla_winforms](../../../../includes/tlasharptla-winforms-md.md)] controls are not continuously scalable. By default, the <xref:System.Windows.Forms.Integration.WindowsFormsHost> element scales its hosted control when possible. To enable full-fledged scaling, set the <xref:System.Windows.Interop.HwndHost.IsRedirected%2A> property of the <xref:System.Windows.Forms.Integration.WindowsFormsHost> to true and the <xref:System.Windows.Interop.HwndHost.CompositionMode%2A> property to <xref:System.Windows.Interop.CompositionMode.Full> or <xref:System.Windows.Interop.CompositionMode.OutputOnly>.
210
+
Unlike WPF elements, most Windows Forms controls are not continuously scalable. To provide custom scaling, you override the <xref:System.Windows.Forms.Integration.WindowsFormsHost.ScaleChild%2A?displayProperty=nameWithType> method.
223
211
224
212
#### To scale a hosted control by using the default behavior
225
213
226
214
1. Copy the following XAML into the <xref:System.Windows.Controls.Grid> element.
2. Press F5 to build and run the application. The hosted control and its surrounding elements are scaled by a factor of 0.5. However, the hosted control's font is not scaled.
231
-
232
-
#### To scale a hosted control by setting IsRedirected to true
233
-
234
-
1. Replace the previous scaling example with the following XAML.
2. Press F5 to build and run the application. The hosted control, its surrounding elements, and the hosted control's font are scaled by a factor of 0.5.
239
-
218
+
2. Press F5 to build and run the application. The hosted control and its surrounding elements are scaled by a factor of 0.5. However, the hosted control's font is not scaled.
219
+
220
+
<!-- This could use an example of custom scaling. -->
221
+
240
222
## Rotating
241
-
Unlike [!INCLUDE[TLA2#tla_winclient](../../../../includes/tla2sharptla-winclient-md.md)] elements, [!INCLUDE[TLA#tla_winforms](../../../../includes/tlasharptla-winforms-md.md)] controls do not support rotation. By default, the <xref:System.Windows.Forms.Integration.WindowsFormsHost> element does not rotate with other [!INCLUDE[TLA2#tla_winclient](../../../../includes/tla2sharptla-winclient-md.md)] elements when a rotation transformation is applied. Any rotation value other than 180 degrees raises the <xref:System.Windows.Forms.Integration.WindowsFormsHost.LayoutError> event. To enable rotating to any angle, set the <xref:System.Windows.Interop.HwndHost.IsRedirected%2A> property of the <xref:System.Windows.Forms.Integration.WindowsFormsHost> to true and the <xref:System.Windows.Interop.HwndHost.CompositionMode%2A> property to <xref:System.Windows.Interop.CompositionMode.Full> or <xref:System.Windows.Interop.CompositionMode.OutputOnly>.
242
-
223
+
Unlike WPF elements, Windows Forms controls do not support rotation. The <xref:System.Windows.Forms.Integration.WindowsFormsHost> element does not rotate with other WPF elements when a rotation transformation is applied. Any rotation value other than 180 degrees raises the <xref:System.Windows.Forms.Integration.WindowsFormsHost.LayoutError> event.
224
+
243
225
#### To see the effect of rotation in a hybrid application
244
226
245
227
1. Copy the following XAML into the <xref:System.Windows.Controls.Grid> element.
2. Press F5 to build and run the application. The hosted control is not rotated, but its surrounding elements are rotated by an angle of 180 degrees. You may have to resize the window to see the elements.
250
-
251
-
#### To see the effect of rotation in a hybrid application when IsRedirected is true
252
-
253
-
1. Replace the previous rotation example with the following XAML.
2. Press F5 to build and run the application. The hosted control is rotated. Note that the <xref:System.Windows.Media.RotateTransform.Angle%2A> property can be set to any value. You may have to resize the window to see the elements.
258
-
232
+
233
+
259
234
## Setting Padding and Margins
260
235
Padding and margins in [!INCLUDE[TLA2#tla_winclient](../../../../includes/tla2sharptla-winclient-md.md)] layout are similar to padding and margins in [!INCLUDE[TLA#tla_winforms](../../../../includes/tlasharptla-winforms-md.md)]. Simply set the <xref:System.Windows.Controls.Control.Padding%2A> and <xref:System.Windows.FrameworkElement.Margin%2A> properties on the <xref:System.Windows.Forms.Integration.WindowsFormsHost> element.
0 commit comments