Microsoft KB Archive/322224

= DOC: MSDN InstanceDescriptor Class Example Is Incorrect =

Article ID: 322224

Article Last Modified on 5/18/2007

-

APPLIES TO


 * MSDN 2003 Universal Edition

-



This article was previously published under Q322224



SUMMARY
The example in the System.ComponentModel.Design.Serialization.InstanceDescriptor class documentation is incorrect in the online Microsoft Developer Network (MSDN) documentation and in the January 2002 media for MSDN. The values that are passed into the constructor do not get assigned to the properties of the class.

To see the System.ComponentModel.Design.Serialization.InstanceDescriptor class documentation, visit the following MSDN Web site:

InstanceDescriptor Class

http://msdn2.microsoft.com/en-us/library/system.componentmodel.design.serialization.instancedescriptor(vs.71).aspx



MORE INFORMATION
The constructor contains ambiguous naming conventions for the constructor arguments and the property procedure names. The property values are stored in private variables of the class but do not get initialized because of this ambiguity.

To correctly implement the constructor, fully qualify the property procedures. When you fully qualify property procedures, any values that are passed into the property procedures are validated, and private variables are initialized.

For example, use the following Microsoft Visual Basic code to correct this problem in the sample: Public Sub New(ByVal point1 As Point, ByVal point2 As Point, ByVal point3 As Point) Me.Point1 = point1 Me.Point2 = point2 Me.Point3 = point3 End Sub 'New Use the following Microsoft Visual C# code to correct this problem in the sample: public Triangle(Point point1,Point point2,Point point3) { this.Point1 = point1; this.Point2 = point2; this.Point3 = point3; }

Keywords: kbbug kbdocerr kbpending KB322224

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.