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 @@ -269,27 +269,23 @@ private static void NotifySources()
{
if (!source.IsDisposed)
{
source.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
new DispatcherOperationCallback(NotifySource),
new object[]{source});
source.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (DispatcherOperationCallback)(state =>
{
PresentationSource source = (PresentationSource)state;
if (source != null && !source.IsDisposed)
{
// setting the RootVisual to itself triggers the logic to
// add to the AutomationEvents list
source.RootVisual = source.RootVisual;
}
return null;
}), source);
}
}
}

private static object NotifySource(Object args)
{
object[] argsArray = (object[])args;
PresentationSource source = argsArray[0] as PresentationSource;
if (source != null && !source.IsDisposed)
{
// setting the RootVisual to itself triggers the logic to
// add to the AutomationEvents list
source.RootVisual = source.RootVisual;
}
return null;
}

private static Dictionary<int, EventInfo> _eventsTable; // key=event id, data=listener count
private readonly static object _lock = new object();
}
}