Beispiel #1
0
 internal Window(RemoteSession session, WindowContext windows, string handle) {
     _session = session;
     _windows = windows;
     _handle = handle;
     if (handle != null)
         _hash = handle.GetHashCode();
 }
Beispiel #2
0
        public void ListWindows(out List windows, out List handles)
        {
            handles = WindowContext.GetWindowsHandles(_session);
            windows = new List(handles.Count);
            foreach (string handle in handles)
            {
                int hash = handle.GetHashCode();
                foreach (Window win in _cachedWindows)
                {
                    if (win.GetHashCode() == hash && handle == win.Handle)
                    {
                        windows.Add(win);
                        goto nextHandle;
                    }
                }
                windows.Add(new Window(_session, this, handle));
nextHandle:
                continue;
            }
            _cachedWindows = windows;
        }