本文整理汇总了C#中System.Windows.Automation.AutomationProperty类的典型用法代码示例。如果您正苦于以下问题:C# AutomationProperty类的具体用法?C# AutomationProperty怎么用?C# AutomationProperty使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AutomationProperty类属于System.Windows.Automation命名空间,在下文中一共展示了AutomationProperty类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WindowPatternIdentifiers
static WindowPatternIdentifiers ()
{
Pattern =
new AutomationPattern (PatternId,
"WindowPatternIdentifiers.Pattern");
CanMaximizeProperty =
new AutomationProperty (CanMaximizePropertyId,
"WindowPatternIdentifiers.CanMaximizeProperty");
CanMinimizeProperty =
new AutomationProperty (CanMinimizePropertyId,
"WindowPatternIdentifiers.CanMinimizeProperty");
IsModalProperty =
new AutomationProperty (IsModalPropertyId,
"WindowPatternIdentifiers.IsModalProperty");
IsTopmostProperty =
new AutomationProperty (IsTopmostPropertyId,
"WindowPatternIdentifiers.IsTopmostProperty");
WindowInteractionStateProperty =
new AutomationProperty (WindowInteractionStatePropertyId,
"WindowPatternIdentifiers.WindowInteractionStateProperty");
WindowVisualStateProperty =
new AutomationProperty (WindowVisualStatePropertyId,
"WindowPatternIdentifiers.WindowVisualStateProperty");
WindowClosedEvent =
new AutomationEvent (WindowClosedEventId,
"WindowPatternIdentifiers.WindowClosedProperty");
WindowOpenedEvent =
new AutomationEvent (WindowOpenedEventId,
"WindowPatternIdentifiers.WindowOpenedProperty");
}
示例2: FindDescendantsBy
public static IEnumerable<AutomationElement> FindDescendantsBy(this AutomationElement ae, AutomationProperty property, object value)
{
return ae.FindAll(
TreeScope.Descendants,
new PropertyCondition(property, value))
.Cast<AutomationElement>();
}
示例3: GetAllChildNodes
public AutomationElementCollection GetAllChildNodes(AutomationElement element, AutomationProperty automationProperty, object value, TreeScope treeScope)
{
var allChildNodes = element.FindAll(treeScope, GetPropertyCondition(automationProperty, value));
if (allChildNodes == null)
throw new ElementNotAvailableException("Not able to find the child nodes of the element");
return allChildNodes;
}
示例4: GetElementProperty
// Process all the Element Properties
internal override object GetElementProperty(AutomationProperty idProp)
{
if (idProp == AutomationElement.IsOffscreenProperty)
{
Rect parentRect = GetParent().BoundingRectangle;
NativeMethods.Win32Rect itemRect = ListViewCheckBoxRect(_hwnd, _listviewItem);
if (itemRect.IsEmpty || parentRect.IsEmpty)
{
return true;
}
if (Misc.MapWindowPoints(_hwnd, IntPtr.Zero, ref itemRect, 2) && !Misc.IsItemVisible(ref parentRect, ref itemRect))
{
return true;
}
}
// EventManager.DispatchEvent() genericaly uses GetElementProperty()
// to get properties during a property change event. Proccess ToggleStateProperty
// so the ToggleStateProperty Change Event can get the correct state.
else if (idProp == TogglePattern.ToggleStateProperty)
{
return ((IToggleProvider)this).ToggleState;
}
return base.GetElementProperty(idProp);
}
示例5: RaisePropertyChangedEvent
public void RaisePropertyChangedEvent (AutomationPeer peer,
AutomationProperty property,
object oldValue,
object newValue)
{
if (!AccessibilityEnabled || peer == null)
return;
if (object.Equals (newValue, oldValue))
return;
// We are going to raise changes only when the value ACTUALLY CHANGES
IAutomationCacheProperty cachedProperty = peer.GetCachedProperty (property);
if (cachedProperty != null) {
if (object.Equals (newValue, cachedProperty.OldValue))
return;
cachedProperty.OldValue = newValue;
}
if (AutomationPropertyChanged != null)
AutomationPropertyChanged (this,
new AutomationPropertyChangedEventArgs (peer,
property,
oldValue,
newValue));
}
示例6: GridItemPatternIdentifiers
static GridItemPatternIdentifiers ()
{
Pattern =
new AutomationPattern (PatternId,
"GridItemPatternIdentifiers.Pattern");
RowProperty =
new AutomationProperty (RowPropertyId,
"GridItemPatternIdentifiers.RowProperty");
ColumnProperty =
new AutomationProperty (ColumnPropertyId,
"GridItemPatternIdentifiers.ColumnProperty");
RowSpanProperty =
new AutomationProperty (RowSpanPropertyId,
"GridItemPatternIdentifiers.RowSpanProperty");
ColumnSpanProperty =
new AutomationProperty (ColumnSpanPropertyId,
"GridItemPatternIdentifiers.ColumnSpanProperty");
ContainingGridProperty =
new AutomationProperty (ContainingGridPropertyId,
"GridItemPatternIdentifiers.ContainingGridProperty");
}
示例7: AdviseEventAdded
//------------------------------------------------------
//
// Patterns Implementation
//
//------------------------------------------------------
#region ProxyHwnd Methods
// ------------------------------------------------------
//
// Internal Methods
//
// ------------------------------------------------------
// Advises proxy that an event has been added.
// Maps the Automation Events into WinEvents and add those to the list of WinEvents notification hooks
internal virtual void AdviseEventAdded (AutomationEvent eventId, AutomationProperty [] aidProps)
{
// No RawElementBase creation callback, exit from here
if (_createOnEvent == null)
{
return;
}
int cEvents = 0;
WinEventTracker.EvtIdProperty [] aEvents;
// Gets an Array of WinEvents to trap on a per window handle basis
if (eventId == AutomationElement.AutomationPropertyChangedEvent)
{
aEvents = PropertyToWinEvent (aidProps, out cEvents);
}
else
{
aEvents = EventToWinEvent (eventId, out cEvents);
}
// If we have WinEvents to trap, add those to the list of WinEvent
// notification list
if (cEvents > 0)
{
WinEventTracker.AddToNotificationList (_hwnd, _createOnEvent, aEvents, cEvents);
}
}
示例8: AutomationPropertyChangedEventArgs
public AutomationPropertyChangedEventArgs (AutomationProperty property, object oldValue, object newValue) :
base (AutomationElementIdentifiers.AutomationPropertyChangedEvent)
{
Property = property;
OldValue = oldValue;
NewValue = newValue;
}
示例9: BaseAutomationPropertyEvent
protected BaseAutomationPropertyEvent (SimpleControlProvider provider,
AutomationProperty property)
: base (provider)
{
this.property = property;
OldValue = Provider.GetPropertyValue (Property.Id);
}
示例10: CreateConditionPathForPropertyValues
public static IEnumerable<Condition> CreateConditionPathForPropertyValues(AutomationProperty property,
IEnumerable<object> values)
{
IEnumerable<PropertyCondition> conditions = values.Select(value => new PropertyCondition(property, value));
return conditions.Cast<Condition>();
}
示例11: ClickTabItem
public static void ClickTabItem(this TestBase @this, AutomationProperty searchBy, object value, AutomationElement retrievedControl = null)
{
Dictionary<AutomationProperty, object> searchCretia = new Dictionary<AutomationProperty, object>();
searchCretia.Add(SearchBy.ByControlType, ControlType.TabItem);
searchCretia.Add(searchBy, value);
var target = @this.App.FindDescendant(searchCretia, retrievedControl);
ControlProvider.Transfer<AETabItem>(target).Select();
}
示例12: SupportsProperty
public bool SupportsProperty (AutomationProperty property)
{
try {
return dbusElement.SupportsProperty (property.Id);
} catch (Exception ex) {
throw DbusExceptionTranslator.Translate (ex);
}
}
示例13: GetPropertyValue
public object GetPropertyValue(AutomationProperty property)
{
if (TestOfMoreThanTwoPatternPropertiesPattern.Standalone1Property.Equals(property))
return 42;
if (TestOfMoreThanTwoPatternPropertiesPattern.NullStringStandaloneProperty.Equals(property))
return null;
return null;
}
示例14: TogglePatternIdentifiers
static TogglePatternIdentifiers ()
{
Pattern =
new AutomationPattern (PatternId,
"TogglePatternIdentifiers.Pattern");
ToggleStateProperty =
new AutomationProperty (ToggleStatePropertyId,
"TogglePatternIdentifiers.ToggleStateProperty");
}
示例15:
// threadsafe
private object this[AutomationProperty property] {
get {
return STAHelper.Invoke(
delegate() {
return element.GetCurrentPropertyValue(property);
}
);
}
}