What should you do?

You create a Windows application by using the .NET Framework 3.5.
You create a Windows user control in the application.
The application contains the following code segment. (Line numbers are included for reference only.)
01 public struct FullName
02 {
03 public string FirstName { get; set; }
04 public string LastName { get; set; }
05 }
The user control has a property named UserName of the FullName type. You add the user control to a
Windows form.
During the design phase, the UserName property must be allowed to update the FirstName and
LastName properties as comma-delimited values in the property window.
You need to ensure that the properties in the FullName structure are represented as string values.
What should you do?

You create a Windows application by using the .NET Framework 3.5.
You create a Windows user control in the application.
The application contains the following code segment. (Line numbers are included for reference only.)
01 public struct FullName
02 {
03 public string FirstName { get; set; }
04 public string LastName { get; set; }
05 }
The user control has a property named UserName of the FullName type. You add the user control to a
Windows form.
During the design phase, the UserName property must be allowed to update the FirstName and
LastName properties as comma-delimited values in the property window.
You need to ensure that the properties in the FullName structure are represented as string values.
What should you do?

A.
Create a TypeConverter class for the FullName structure.

B.
Override the ToString method for the FullName structure.

C.
Implement the IFormattable interface for the FullName structure.

D.
Implement the IConvertible interface for the FullName structure.



Leave a Reply 0

Your email address will not be published. Required fields are marked *