mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 04:37:30 +02:00
Add clipboard plugin.
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using Wox.Helper;
|
||||
using Wox.Infrastructure;
|
||||
using Wox.Plugin;
|
||||
@@ -58,6 +59,29 @@ namespace Wox
|
||||
return location;
|
||||
}
|
||||
|
||||
private FrameworkElement FindByName(string name, FrameworkElement root)
|
||||
{
|
||||
Stack<FrameworkElement> tree = new Stack<FrameworkElement>();
|
||||
tree.Push(root);
|
||||
|
||||
while (tree.Count > 0)
|
||||
{
|
||||
FrameworkElement current = tree.Pop();
|
||||
if (current.Name == name)
|
||||
return current;
|
||||
|
||||
int count = VisualTreeHelper.GetChildrenCount(current);
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
DependencyObject child = VisualTreeHelper.GetChild(current, i);
|
||||
if (child is FrameworkElement)
|
||||
tree.Push((FrameworkElement)child);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void SelectNext()
|
||||
{
|
||||
int index = lbResults.SelectedIndex;
|
||||
|
||||
Reference in New Issue
Block a user