Beispiel #1
0
 internal void CloseProcesses()
 {
     foreach (LgWindow m in Windows)
     {
         LgProcessManager.Stop(m.Process);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Update coordiantes of this windows.
        ///
        /// When the window is moved and the changes need to be saved then this function updates the changes.
        /// </summary>
        internal void UpdatePosition()
        {
            LgRectangle rec = LgProcessManager.GetWindowRectange(Process);

            TopLeft.X = rec.X1;
            TopLeft.Y = rec.Y1;
            Size      = rec.GetSize();
        }
Beispiel #3
0
        /// <summary>
        /// Move the window to the position specified in the config
        /// </summary>
        /// <returns></returns>
        internal Boolean RepositionWindows()
        {
            Boolean allOk = true;

            foreach (LgWindow m in Windows)
            {
                allOk &= LgProcessManager.Reposition(m);
            }

            return(allOk);
        }
Beispiel #4
0
        /// <summary>
        /// Start the processes in this configuration
        /// </summary>
        /// <returns></returns>
        internal Boolean StartProcesses()
        {
            WasStarted = true;
            Boolean allOk = true;

            foreach (LgWindow m in Windows)
            {
                allOk &= LgProcessManager.Start(m.Process);
            }

            return(allOk);
        }
Beispiel #5
0
        /// <summary>
        /// Add new Window to the config from a coordinate in the screen. Usually from a mouse click.
        /// </summary>
        /// <param name="point">point in screen</param>
        /// <returns></returns>
        internal Boolean AddWindow(LgPoint point)
        {
            Boolean result = true;
            Process p      = LgProcessManager.GetProcessAtCoordiante(point);

            // before adding check if it is current process
            if (!LgProcessManager.IsCurrentProcess(p))
            {
                LgProcess   process = LgProcess.FromProcess(p);
                LgRectangle rec     = LgProcessManager.GetWindowRectange(process);
                LgWindow    window  = new LgWindow(rec.GetTopLeft(), rec.GetSize(), process);
                // add to list
                Windows.Add(window);
                Console.WriteLine(window);
            }
            else
            {
                result = false;
            }

            return(result);
        }
Beispiel #6
0
 /// <summary>
 /// Minimize window
 /// </summary>
 internal void Minimize()
 {
     LgProcessManager.MinimizeWindow(Process);
 }
Beispiel #7
0
 /// <summary>
 /// Show window if minimized.
 /// </summary>
 internal void Show()
 {
     LgProcessManager.ShowWindow(Process);
 }