c# Custom Code Attributes

profiletom229

 

Requirements: Create a C# program that includes:

 

1.A properly designed user defined C# attribute class that:

  • Can be applied to classes and struct declarations only. 

  • Has 3 public properties to store the name and ID of the student who created the code as well the code version #. Student name and ID properties must be read-only (no set accessor) while the version # property must be read-write one. To simplify your code assume that the version # is of type int.

  • Has at least one constructor that takes as arguments student name and student ID. The version # argument should be optional.

  • Overrides the ToString() method to present a user friendly description of all class’s properties.

2.Test the attribute class created by adding this attribute to your assignment 2 code and displaying the attribute information in the Main() method. Make sure that the version # of the code set and shown is 2 or higher.

 

 

3.Include into the report detailed analysis of the Custom Code Attributes API features used.

    • 10 years ago
    • 10
    Answer(1)

    Purchase the answer to view it

    blurred-text
    NOT RATED
    • attachment
      cs.zip