Esempio n. 1
0
        public CscriptLauncherMenuItem(CovenantAPI CovenantClient, EventPrinter EventPrinter) : base(CovenantClient, EventPrinter)
        {
            this.cscriptLauncher = CovenantClient.ApiLaunchersCscriptGet();
            this.MenuTitle       = cscriptLauncher.Name;
            this.MenuDescription = cscriptLauncher.Description;

            this.AdditionalOptions.Add(new MenuCommandCscriptLauncherShow(CovenantClient));
            this.AdditionalOptions.Add(new MenuCommandCscriptLauncherGenerate(CovenantClient));
            this.AdditionalOptions.Add(new MenuCommandCscriptLauncherCode());
            this.AdditionalOptions.Add(new MenuCommandCscriptLauncherHost(CovenantClient));
            this.AdditionalOptions.Add(new MenuCommandCscriptLauncherWriteFile());
            var setCommand = new MenuCommandCscriptLauncherSet(CovenantClient);

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

            this.Refresh();
        }
        public CscriptLauncherMenuItem(CovenantAPI CovenantClient) : base(CovenantClient)
        {
            try
            {
                this.CscriptLauncher = CovenantClient.ApiLaunchersCscriptGet();
                this.MenuTitle       = CscriptLauncher.Name;
                this.MenuDescription = CscriptLauncher.Description;

                this.AdditionalOptions.Add(new MenuCommandCscriptLauncherShow(CovenantClient));
                this.AdditionalOptions.Add(new MenuCommandCscriptLauncherGenerate(CovenantClient));
                this.AdditionalOptions.Add(new MenuCommandCscriptLauncherCode(CovenantClient));
                this.AdditionalOptions.Add(new MenuCommandCscriptLauncherHost(CovenantClient));
                this.AdditionalOptions.Add(new MenuCommandCscriptLauncherWriteFile(CovenantClient));
                var setCommand = new MenuCommandCscriptLauncherSet(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);
            }
        }