public override System.Collections.Generic.IEnumerable <Item> Perform(System.Collections.Generic.IEnumerable <Item> items, System.Collections.Generic.IEnumerable <Item> modItems)
        {
            WindowItem item = items.First() as WindowItem;

            if (item != null)
            {
                Utils.ActiveWindow(item.MyWindow);
            }
            yield break;
        }
Пример #2
0
        protected override void Enable()
        {
            ItemsAvailableEventArgs eventArgs = new ItemsAvailableEventArgs();

            lock (windowlist) {
                Screen.Default.ForceUpdate();
                foreach (Window win in Utils.GetWindows())
                {
                    Log.Debug("title is {0}, pid is {1}, processname is {2}", win.Name, win.Application.Pid, win.Application.Name);
                    String iconpath = String.Format("/tmp/{0}.png", win.Application.Pid);
                    win.Icon.Save(iconpath, "png");
                    WindowItem item = new WindowItem(win, iconpath);
                    windowlist [win] = item;
                }
                eventArgs.newItems = windowlist.Values;
            }

            RaiseItemsAvailable(eventArgs);
        }