示例#1
0
        /// <summary>
        /// Attempts to run the application as a command line application.  If it
        /// is supposed to run in normal (system tray) mode, then this does not do
        /// anything and returns false.  It returns true if the application was run
        /// in command line mode.
        /// </summary>
        public Boolean Run()
        {
            if (_commandLineParser.RepositionNow)
            {
                OffScreenWindowRepositioner.RepositionWindows();
                return(true);
            }

            return(false);
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        private void RepositionWindows()
        {
            int windowCount = OffScreenWindowRepositioner.RepositionWindows();

            notifyIcon.BalloonTipTitle = "SheepDog";

            if (windowCount == 0)
            {
                notifyIcon.BalloonTipText = "No offscreen windows detected";
            }
            else if (windowCount == 1)
            {
                notifyIcon.BalloonTipText = windowCount + " window repositioned";
            }
            else
            {
                notifyIcon.BalloonTipText = windowCount + " windows repositioned";
            }

            notifyIcon.ShowBalloonTip(2000);
        }