コード例 #1
0
        public InstallUtilLauncherMenuItem(CovenantAPI CovenantClient, EventPrinter EventPrinter) : base(CovenantClient, EventPrinter)
        {
            this.installutilLauncher = CovenantClient.ApiLaunchersInstallutilGet();
            this.MenuTitle           = installutilLauncher.Name;
            this.MenuDescription     = installutilLauncher.Description;

            this.AdditionalOptions.Add(new MenuCommandInstallUtilLauncherShow(CovenantClient));
            this.AdditionalOptions.Add(new MenuCommandInstallUtilLauncherGenerate(CovenantClient));
            this.AdditionalOptions.Add(new MenuCommandInstallUtilLauncherCode());
            this.AdditionalOptions.Add(new MenuCommandInstallUtilLauncherHost(CovenantClient));
            this.AdditionalOptions.Add(new MenuCommandInstallUtilLauncherWriteFile());
            var setCommand = new MenuCommandInstallUtilLauncherSet(CovenantClient);

            this.AdditionalOptions.Add(setCommand);
            this.AdditionalOptions.Add(new MenuCommandGenericUnset(setCommand.Parameters.FirstOrDefault(P => P.Name == "Option").Values));

            this.Refresh();
        }
コード例 #2
0
        public InstallUtilLauncherMenuItem(CovenantAPI CovenantClient) : base(CovenantClient)
        {
            try
            {
                this.InstallUtilLauncher = CovenantClient.ApiLaunchersInstallutilGet();
                this.MenuTitle           = InstallUtilLauncher.Name;
                this.MenuDescription     = InstallUtilLauncher.Description;

                this.AdditionalOptions.Add(new MenuCommandInstallUtilLauncherShow(CovenantClient));
                this.AdditionalOptions.Add(new MenuCommandInstallUtilLauncherGenerate(CovenantClient));
                this.AdditionalOptions.Add(new MenuCommandInstallUtilLauncherCode(CovenantClient));
                this.AdditionalOptions.Add(new MenuCommandInstallUtilLauncherHost(CovenantClient));
                this.AdditionalOptions.Add(new MenuCommandInstallUtilLauncherWriteFile(CovenantClient));
                var setCommand = new MenuCommandInstallUtilLauncherSet(CovenantClient);
                this.AdditionalOptions.Add(setCommand);
                this.AdditionalOptions.Add(new MenuCommandGenericUnset(setCommand.Parameters.FirstOrDefault(P => P.Name == "Option").Values));
            }
            catch (HttpOperationException e)
            {
                EliteConsole.PrintFormattedWarningLine("CovenantException: " + e.Response.Content);
            }
        }