Ejemplo n.º 1
0
        static void Main()
        {
            string[] args = Environment.GetCommandLineArgs();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            TaskbarManager.Instance.ApplicationId = "JumperDebug";

            bool   refreshOnTop = true;
            string shortcutDir  = null;

            if (args.Contains("--bottom"))
            {
                refreshOnTop = false;
            }

            string launchPath = GetArgValue(args, "--launch");

            shortcutDir = GetArgValue(args, "--dir");

            if (args.Contains("--refresh"))
            {
                TaskbarManager.Instance.ApplicationId = "Jumper@" + shortcutDir;
                JumpForm.RefreshJumpList(IntPtr.Zero, shortcutDir, refreshOnTop);
                return;
            }

            if (!String.IsNullOrEmpty(launchPath))
            {
                Launch(launchPath);
            }
            else
            {
                JumpForm mainForm = new JumpForm();
                mainForm.RefreshOnTop = refreshOnTop;
                if (shortcutDir == null && args.Length == 2)
                {
                    shortcutDir = args[1];
                }
                mainForm.ShortcutsFolder = Directory.Exists(shortcutDir) ? shortcutDir : null;

                Application.Run(mainForm);
            }
        }
Ejemplo n.º 2
0
        static void Main()
        {
            string[] args = Environment.GetCommandLineArgs();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            TaskbarManager.Instance.ApplicationId = "JumperDebug";

            bool refreshOnTop = true;
            string shortcutDir = null;

            if (args.Contains("--bottom"))
            {
                refreshOnTop = false;
            }

            string launchPath = GetArgValue(args, "--launch");
            shortcutDir = GetArgValue(args, "--dir");

            if (args.Contains("--refresh"))
            {
                TaskbarManager.Instance.ApplicationId = "Jumper@" + shortcutDir;
                JumpForm.RefreshJumpList(IntPtr.Zero, shortcutDir, refreshOnTop);
                return;
            }

            if (!String.IsNullOrEmpty(launchPath))
            {
                Launch(launchPath);
            }
            else
            {
                JumpForm mainForm = new JumpForm();
                mainForm.RefreshOnTop = refreshOnTop;
                if (shortcutDir == null && args.Length == 2)
                    shortcutDir = args[1];
                mainForm.ShortcutsFolder = Directory.Exists(shortcutDir) ? shortcutDir : null;

                Application.Run(mainForm);
            }
        }