예제 #1
0
		public WscriptLauncherMenuItem(CovenantAPI CovenantClient, EventPrinter EventPrinter) : base(CovenantClient, EventPrinter)
        {
            this.wscriptLauncher = CovenantClient.ApiLaunchersWscriptGet();
            this.MenuTitle = wscriptLauncher.Name;
            this.MenuDescription = wscriptLauncher.Description;

            this.AdditionalOptions.Add(new MenuCommandWscriptLauncherShow(CovenantClient));
            this.AdditionalOptions.Add(new MenuCommandWscriptLauncherGenerate(CovenantClient));
            this.AdditionalOptions.Add(new MenuCommandWscriptLauncherCode());
            this.AdditionalOptions.Add(new MenuCommandWscriptLauncherHost(CovenantClient));
            this.AdditionalOptions.Add(new MenuCommandWscriptLauncherWriteFile());
            var setCommand = new MenuCommandWscriptLauncherSet(CovenantClient);
            this.AdditionalOptions.Add(setCommand);
            this.AdditionalOptions.Add(new MenuCommandGenericUnset(setCommand.Parameters.FirstOrDefault(P => P.Name == "Option").Values));

            this.Refresh();
        }
예제 #2
0
        public WscriptLauncherMenuItem(CovenantAPI CovenantClient) : base(CovenantClient)
        {
            try
            {
                this.WscriptLauncher = CovenantClient.ApiLaunchersWscriptGet();
                this.MenuTitle       = WscriptLauncher.Name;
                this.MenuDescription = WscriptLauncher.Description;

                this.AdditionalOptions.Add(new MenuCommandWscriptLauncherShow(CovenantClient));
                this.AdditionalOptions.Add(new MenuCommandWscriptLauncherGenerate(CovenantClient));
                this.AdditionalOptions.Add(new MenuCommandWscriptLauncherCode(CovenantClient));
                this.AdditionalOptions.Add(new MenuCommandWscriptLauncherHost(CovenantClient));
                this.AdditionalOptions.Add(new MenuCommandWscriptLauncherWriteFile(CovenantClient));
                var setCommand = new MenuCommandWscriptLauncherSet(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);
            }
        }