About the ExtendedOptions class (.NET)

 

The ExtendedOptions class is used to set the preferences and options used by the GetExtendedBrowser method for gathering extended property results.

 

Syntax:

 ExtendedOptions options = new ExtendedOptions();

 ExtendedOptions options = new ExtendedOptions(string listOfPropertiesToDetect); 

 

For example, the ExtendedOptions class is used to set which extended properties should be tested and what message to display in the browser during the test.

 

The most common method of the ExtendedOptions class is the AddProperties method. This method is used to set which of the extended properties should be tested. Likewise you can also use the ExtendedOptions(string) constructor to pass in a string of the properties you want tested – in this form BrowserHawk automatically calls AddProperties for you, as demonstrated in Example 2 below.

 

C# Example 1:

<%

ExtendedOptions options = new ExtendedOptions();

options.AddProperties("JavaScriptEnabled");

ExtendedBrowserObj extBrow = BrowserObj.GetExtendedBrowser(options);

%>

<html>

JavaScriptEnabled: <% Response.Write(extBrow.JavaScriptEnabled); %>

</html>

 

C# Example 2:

<%

ExtendedOptions options = new ExtendedOptions("JavaScriptEnabled");

ExtendedBrowserObj extBrow = BrowserObj.GetExtendedBrowser(options);

%>

<html>

JavaScriptEnabled: <% Response.Write(extBrow.JavaScriptEnabled); %>

</html>

 

Example 1 and 2 are functionality equivalent. Example 2 demonstrates a coding convenience by having the construction call AddProperties for you.