Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public ProviderOptions ProviderOptions
{
return ProviderOptions.ServerSideProvider;
}
return (ProviderOptions)ElementUtil.Invoke(peer, new DispatcherOperationCallback( InContextGetProviderOptions ), null);
return (ProviderOptions)ElementUtil.Invoke(peer, state => ((ElementProxy)state).InContextGetProviderOptions(), this);
}
}

Expand Down Expand Up @@ -168,7 +168,7 @@ public int [ ] GetRuntimeId()
{
throw new ElementNotAvailableException();
}
return (int []) ElementUtil.Invoke( peer, new DispatcherOperationCallback( InContextGetRuntimeId ), null );
return (int []) ElementUtil.Invoke( peer, state => ((ElementProxy)state).InContextGetRuntimeId(), this);
}

public Rect BoundingRectangle
Expand All @@ -180,7 +180,7 @@ public Rect BoundingRectangle
{
throw new ElementNotAvailableException();
}
return (Rect)ElementUtil.Invoke(peer, new DispatcherOperationCallback(InContextBoundingRectangle), null);
return (Rect)ElementUtil.Invoke(peer, state => ((ElementProxy)state).InContextBoundingRectangle(), this);
}
}

Expand All @@ -196,7 +196,7 @@ public void SetFocus()
{
throw new ElementNotAvailableException();
}
ElementUtil.Invoke(peer, new DispatcherOperationCallback( InContextSetFocus ), null);
ElementUtil.Invoke(peer, state => ((ElementProxy)state).InContextSetFocus(), this);
}

public IRawElementProviderFragmentRoot FragmentRoot
Expand All @@ -208,7 +208,7 @@ public IRawElementProviderFragmentRoot FragmentRoot
{
return null;
}
return (IRawElementProviderFragmentRoot) ElementUtil.Invoke( peer, new DispatcherOperationCallback( InContextFragmentRoot ), null );
return (IRawElementProviderFragmentRoot) ElementUtil.Invoke( peer, state => ((ElementProxy)state).InContextFragmentRoot(), this);
}
}

Expand All @@ -230,7 +230,7 @@ public IRawElementProviderFragment GetFocus()
{
return null;
}
return (IRawElementProviderFragment) ElementUtil.Invoke( peer, new DispatcherOperationCallback( InContextGetFocus ), null );
return (IRawElementProviderFragment) ElementUtil.Invoke( peer, state => ((ElementProxy)state).InContextGetFocus(), this);
}

// Event support: EventMap is a static class and access is synchronized, so no need to access it in UI thread context.
Expand Down Expand Up @@ -344,7 +344,7 @@ private object InContextElementProviderFromPoint( object arg )
}

// Return proxy representing currently focused element (if any)
private object InContextGetFocus( object unused )
private object InContextGetFocus()
{
// Note: - what if a custom element - eg anchor in a text box - has focus?
// won't have a UIElement there, can we even find the host?
Expand Down Expand Up @@ -427,7 +427,7 @@ private object InContextNavigate( object arg )


// Return value for specified property; or null if not supported
private object InContextGetProviderOptions( object arg )
private object InContextGetProviderOptions()
{
ProviderOptions options = ProviderOptions.ServerSideProvider;
AutomationPeer peer = Peer;
Expand Down Expand Up @@ -464,7 +464,7 @@ private object InContextGetHostRawElementProvider( object unused )
}

// Return unique ID for this element...
private object InContextGetRuntimeId( object unused )
private object InContextGetRuntimeId()
{
AutomationPeer peer = Peer;
if (peer == null)
Expand All @@ -475,7 +475,7 @@ private object InContextGetRuntimeId( object unused )
}

// Return bounding rectangle (screen coords) for this element...
private object InContextBoundingRectangle(object unused)
private object InContextBoundingRectangle()
{
AutomationPeer peer = Peer;
if (peer == null)
Expand All @@ -486,7 +486,7 @@ private object InContextBoundingRectangle(object unused)
}

// Set focus to this element...
private object InContextSetFocus( object unused )
private object InContextSetFocus()
{
AutomationPeer peer = Peer;
if (peer == null)
Expand All @@ -498,7 +498,7 @@ private object InContextSetFocus( object unused )
}

// Return proxy representing the root of this WCP tree...
private object InContextFragmentRoot( object unused )
private object InContextFragmentRoot()
{
AutomationPeer peer = Peer;
AutomationPeer root = peer;
Expand Down