public HTTPListenerMenuItem(CovenantAPI CovenantClient) : base(CovenantClient) { this.MenuTitle = "HTTP"; this.AdditionalOptions.Add(new MenuCommandHTTPListenerShow()); this.AdditionalOptions.Add(new MenuCommandHTTPListenerStart(this.CovenantClient)); var setCommand = new MenuCommandHTTPListenerSet(this.CovenantClient); this.AdditionalOptions.Add(setCommand); this.AdditionalOptions.Add(new MenuCommandGenericUnset(setCommand.Parameters.FirstOrDefault(P => P.Name == "Option").Values)); }
public HTTPListenerMenuItem(CovenantAPI CovenantClient, EventPrinter EventPrinter) : base(CovenantClient, EventPrinter) { this.httpListener = this.CovenantClient.ApiListenersHttpPost(new HttpListener()); this.httpProfile = this.CovenantClient.ApiListenersByIdProfileGet(this.httpListener.Id ?? default); this.listenerType = this.CovenantClient.ApiListenersTypesGet().FirstOrDefault(LT => LT.Name == "HTTP"); this.MenuTitle = listenerType.Name; this.MenuDescription = listenerType.Description; this.AdditionalOptions.Add(new MenuCommandHTTPListenerShow()); this.AdditionalOptions.Add(new MenuCommandHTTPListenerStart(this.CovenantClient, this.EventPrinter)); var setCommand = new MenuCommandHTTPListenerSet(this.CovenantClient); this.AdditionalOptions.Add(setCommand); this.AdditionalOptions.Add(new MenuCommandGenericUnset(setCommand.Parameters.FirstOrDefault(P => P.Name == "Option").Values)); this.Refresh(); }