ClassAutomationObject<T>
Represents an object that can be automated inside a Silverlight/WPF App.
Definition
Namespace:ArtOfTest.WebAii.Silverlight
Assembly:ArtOfTest.WebAii.dll
Type Parameters:
T
The AutomationPeer type of the object.
Syntax:
[DataContract]
public abstract class AutomationObject<T> : IAutomationPeer, IPeerConverter
Inheritance: objectAutomationObject<T>
Derived Classes:
Implements:
Constructors
AutomationObject()
Initializes a new instance of the AutomationObject<T> class.
Declaration
public AutomationObject()
AutomationObject(AutomationReference)
Create a new AutomationObject.
Declaration
public AutomationObject(AutomationReference reference)
Parameters
reference
The object reference.
Properties
PropertyBag
The automation object property bag.
Declaration
public Dictionary<string, object> PropertyBag { get; set; }
Property Value
The entire property bag.
Implements
Reference
Get or set the object reference.
Declaration
public AutomationReference Reference { get; set; }
Property Value
Implements
Methods
AssignReference(AutomationReference)
Assign a reference to this AutomationObject.
Declaration
public virtual void AssignReference(AutomationReference reference)
Parameters
reference
The automation reference.
Implements
Deserialize(string)
Deserialize this AutomationObject to a jsonString TODO: Should this be a static method?
FromRealObject(object)
Converts a Silverlight object to an AutomationObject
Declaration
public virtual void FromRealObject(object o)
Parameters
o
The Silverlight object to convert.
Implements
GetProperty(AutomationProperty)
Get a property on this automation object.
Declaration
public virtual object GetProperty(AutomationProperty property)
Parameters
property
The name of the property to retrieve
Returns
The value of the property
GetProperty(AutomationProperty, object)
Gets a property on this automation object, or returns a default value if the property cannot be retrieved
Declaration
public virtual object GetProperty(AutomationProperty property, object defaultValue)
Parameters
property
The name of the property to retrieve
defaultValue
The value to be returned if the property cannot be retrieved
Returns
The value of the property, or defaultValue if an error occurs while retrieving the property
GetRealType()
Gets the real peer type
InvokeMethod(AutomationMethod, params object[])
Invokes a method on the AutomationObject's client-side peer
Declaration
public virtual object InvokeMethod(AutomationMethod method, params object[] parameters)
Parameters
method
An AutomationMethod specifying the method to invoke on the peer
parameters
object[]
The parameters for the method call
Returns
null
Remarks
Only simple parameters (numbers, booleans, and strings) are supported, and return values are not yet passed back from the automation peer
InvokeMethod(string, params object[])
Invokes a method on the AutomationObject's client-side peer
Declaration
public virtual object InvokeMethod(string methodName, params object[] parameters)
Parameters
methodName
The name of the method to invoke
parameters
object[]
The parameters for the method call
Returns
null
Remarks
Only simple parameters (numbers, booleans, and string) are supported, and return values are not yet passed back from the automation peer
Serialize()
Serialize this automation object to a Json String
Declaration
public virtual string Serialize()
Returns
The Json string representation of this object.
Implements
SetProperty(AutomationProperty, object)
Set a property on this automation object.
Declaration
public virtual void SetProperty(AutomationProperty property, object value)
Parameters
property
The property.
value
The value.
ToRealObject()
Converts an automation object to the real object.
Declaration
public virtual object ToRealObject()
Returns
The Silverlight object.
Implements