Question:You are creating an application that retrieves values from a custom section of the application configuration file. The custom section uses XML as shown in the following block.
<ProjectSection name="Project1">
<role name="administrator" />
<role name="manager" />
<role name="support" />
</ProjectSection>
You need to write a code segment to define a class named Role. You need to ensure that the Role class is initialized with values that are retrieved from the custom section of the configuration file.
Which code segment should you use?
 

A public ref class Role : public ConfigurationElement { protected :
static String= _ElementName = "name";
public :
[ConfigurationProperty("role")]
property
String= Name { String= get () {return ((String=)base["role"]);}
}
}; 

B public ref class Role : public ConfigurationElement { private :
"A Composite Solution With Just One Click" - Certification Guaranteed 298 Microsoft 70-536 Exam String= _name;
protected :
static String= _ElementName = "name";
public :
[ConfigurationProperty("role", IsRequired = true)]
property String= Name {
String= get () {return _name;}
}
}; 

C public ref class Role : public ConfigurationElement { private :
String= _name;
protected :
static String= _ElementName = "role";
public :
[ConfigurationProperty("name")]
property String= Name {
String= get () {return _name;}
}
}; 

D public ref class Role : public ConfigurationElement { protected :
static String= _ElementName = "role";
public :
[ConfigurationProperty("name", IsRequired = true)]
property String= Name {
String= get () {return ((String=)base["name"]);}
}
 }; 

+ Answer
+ Report
Total Preview: 1129

Copyright © 2024. Powered by Intellect Software Ltd