/// <summary> /// Initializes a new instance of the <see cref="InfragisticsControlToDataTableAdapter"/> class. /// </summary> /// <param name="browser">The browser.</param> /// <param name="elementType">Type of the element.</param> /// <param name="jsonConverter">The json deserializer.</param> /// <exception cref="System.ArgumentNullException">browser</exception> /// <exception cref="System.ArgumentException">elementType</exception> public InfragisticsControlToDataTableAdapter(IWebDriver browser, string elementType, IJsonToDataTableConverter jsonConverter = null) { if (browser == null) { throw new ArgumentNullException("browser"); } if (string.IsNullOrEmpty(elementType)) { throw new ArgumentException("elementType"); } _browser = browser; _elementType = elementType; _jsonConverter = jsonConverter ?? new DefaultJsonToDataTableConverter(); }
/// <summary> /// Gets a DataTable from an Infragistics control by using javascript to get the datasource and then /// converting the JSON notation into a .NET DataTable. /// </summary> /// <param name="self">The Web Browser</param> /// <param name="elementType">The type of Infragistics control (igGrid, igDataChart, etc)</param> /// <param name="element">An IWebElement that points to the specified control.</param> /// <param name="jsonConverter">The json converter that converts a json string into a DataTable.</param> /// <param name="columnDefinitions">(Optional) The columns to be retrieved. The names and types of the columns must be compatible with the names of the properties on the javascript objects that back the ig-control</param> /// <returns> /// A DataTable with all of the data from the datasource of the infragistics control. /// </returns> public static DataTable GetDataFromIgControl(this IWebDriver self, string elementType, IWebElement element, IJsonToDataTableConverter jsonConverter, params DataColumnDefinition[] columnDefinitions) { return(new InfragisticsControlToDataTableAdapter(self, elementType, jsonConverter) .GetDataTable(element, columnDefinitions)); }
/// <summary> /// Gets a DataTable from an igDataChart control by using javascript to get the datasource and then /// converting the JSON notation into a .NET DataTable. /// </summary> /// <param name="self">The Web Browser</param> /// <param name="element">An IWebElement that points to the specified control.</param> /// <param name="jsonConverter">The json converter that converts a json string into a DataTable.</param> /// <param name="columnDefinitions">(Optional) The columns to be retrieved. The names and types of the columns must be compatible with the names of the properties on the javascript objects that back the ig-control</param> /// <returns> /// A DataTable with all of the data from the datasource of the igDataChart control. /// </returns> public static DataTable GetDataFromIgDataChart(this IWebDriver self, IWebElement element, IJsonToDataTableConverter jsonConverter, params DataColumnDefinition[] columnDefinitions) { return(GetDataFromIgControl(self, igDataChart, element, jsonConverter, columnDefinitions)); }