|
/*
* This file is licensed under the Code Project CPOL License
* http://www.codeproject.com/info/cpol10.aspx
*
* © Steffen Schütte 2008
*/
using System;
using System.Collections.Generic;
using System.Text;
namespace de.steffenschuette.UITest.Framework
{
/// <summary>
/// This class contains a dictionary with all gathered UI elements
/// for the form with the name FormName.
/// </summary>
internal class UIFormInfo
{
/// <summary>
/// Dicitionary containing the UIItemInfo for each item id.
/// </summary>
private IDictionary<string, UIElementInfo> uiElements;
private string formName;
public string FormName
{
get { return formName; }
}
public UIFormInfo(string formName, IDictionary<string, UIElementInfo> uiElements)
{
this.uiElements = uiElements;
this.formName = formName;
}
/// <summary>
/// Gets the UI element with the given id.
/// </summary>
/// <param name="elementId">The element id.</param>
/// <returns></returns>
public UIElementInfo GetUIElementInfo(string elementId)
{
//return the element if it exists
if (uiElements.ContainsKey(elementId))
{
return uiElements[elementId];
}
else
{
throw new Exception("Element with key '" + elementId + "' not found in form '" + formName + "'!");
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.