Exemplo n.º 1
0
 private void TryRehook()
 {
     if (DUIHandler.GetAllInfos())
     {
         rehooktimer.Stop();
         DUIHook.Rehook();
     }
 }
Exemplo n.º 2
0
        internal static void RunCommand(RunCommandType runCommandType)
        {
            switch (runCommandType)
            {
            case RunCommandType.ShowSettings:
            {
                if (FlyoutHandler.HasInitialized)
                {
                    FlyoutHandler.ShowSettingsWindow();
                }
                else
                {
                    FlyoutHandler.Initialized += (_, __) => FlyoutHandler.ShowSettingsWindow();
                }
                break;
            }

            case RunCommandType.RestoreDefault:
            {
                if (!DUIHandler.IsDUIAvailable())
                {
                    DUIHandler.GetAllInfos();
                }
                FlyoutHandler.SafelyExitApplication();
                break;
            }

            case RunCommandType.SafeExit:
            {
                FlyoutHandler.SafelyExitApplication();
                break;
            }

            case RunCommandType.AppUpdated:
            {
                if (AppLifecycleManager.IsBuildBetaChannel)
                {
                    MessageBox.Show("App update successfully!", AppName);
                }

                break;
            }

            default:
                break;
            }
        }
Exemplo n.º 3
0
        public static void ProcessCommandLineArgs(IList <string> args, bool isFirstInstance = true)
        {
            string arg = string.Empty;

            if ((isFirstInstance && args?.Count > 0) || (!isFirstInstance && args?.Count > 1))
            {
                arg = isFirstInstance ? args[0] : args[1];
            }

            if (arg == string.Empty)
            {
                if (!isFirstInstance)
                {
                    FlyoutHandler.ShowSettingsWindow();
                }
            }
            else if (arg.ToLowerInvariant() == arg_settings)
            {
                if (FlyoutHandler.HasInitialized)
                {
                    FlyoutHandler.ShowSettingsWindow();
                }
                else
                {
                    FlyoutHandler.Initialized += (_, __) => FlyoutHandler.ShowSettingsWindow();
                }
            }
            else if (arg.ToLowerInvariant() == arg_restore)
            {
                if (!DUIHandler.IsDUIAvailable())
                {
                    DUIHandler.GetAllInfos();
                }
                FlyoutHandler.SafelyExitApplication();
            }
            else if (arg.ToLowerInvariant() == arg_exit)
            {
                FlyoutHandler.SafelyExitApplication();
            }
        }
Exemplo n.º 4
0
        internal static void RunCommand(RunCommandType runCommandType)
        {
            switch (runCommandType)
            {
            case RunCommandType.ShowSettings:
            {
                if (FlyoutHandler.HasInitialized)
                {
                    FlyoutHandler.ShowSettingsWindow();
                }
                else
                {
                    FlyoutHandler.Initialized += (_, __) => FlyoutHandler.ShowSettingsWindow();
                }
                break;
            }

            case RunCommandType.RestoreDefault:
            {
                if (!DUIHandler.IsDUIAvailable())
                {
                    DUIHandler.GetAllInfos();
                }
                FlyoutHandler.SafelyExitApplication();
                break;
            }

            case RunCommandType.SafeExit:
            {
                FlyoutHandler.SafelyExitApplication();
                break;
            }

            default:
                break;
            }
        }