Beispiel #1
0
        /**
         * <summary>
         * windowTiler で取得できる位置情報に基づいてウィンドウの位置を移動する
         * </summary>
         */
        public void ArrangeWindows(WindowTiler windowTiler)
        {
            for (int i = 0; i < this.windowInfos.Count; i++)
            {
                var windowInfoWithHandle = this.windowInfos[i];
                var windowHandle         = windowInfoWithHandle.windowHandle;
                var currentWindowRect    = windowInfoWithHandle.GetCurrentWindowRect();
                var toBeWindowRect       = windowTiler.GetWindowRectOf(i);

                // toBeWindowRect == null の場合はもとの位置に戻す
                if (toBeWindowRect == null)
                {
                    var asIsWindowRect = windowInfoWithHandle.GetOriginalWindowRect();

                    this.MoveWindow(windowInfoWithHandle, asIsWindowRect);
                    continue;
                }

                if (!toBeWindowRect.Equals(currentWindowRect))
                {
                    this.MoveWindow(windowInfoWithHandle, toBeWindowRect);
                }
            }
        }