Exemple #1
0
 public OptionsParser(IIpAddressProcessor ipOptions, IOperatingSystemProcessor operatingSystemProcessor, IHostNameProcessor hostNameProcessor, IScript script)
 {
     _ipOptions = ipOptions;
     _operatingSystemProcessor = operatingSystemProcessor;
     _hostNameProcessor        = hostNameProcessor;
     _script = script;
 }
Exemple #2
0
 public void GetOperatingSystem(IOperatingSystemProcessor operatingSystemProcessor)
 {
     Get["/os"] = parameters =>
     {
         var operatingSystem       = operatingSystemProcessor.GetOperatingSystem();
         var operatingSystemOutput = new MachineInformationResults
         {
             output = operatingSystem
         };
         return(Response.AsJson(operatingSystemOutput));
     };
 }
 public void GetOperatingSystem(IOperatingSystemProcessor operatingSystemProcessor)
 {
     Get["/os"] = parameters =>
     {
         try
         {
             var operatingSystem       = operatingSystemProcessor.GetOperatingSystem();
             var operatingSystemOutput = new MachineInformationResults
             {
                 result = operatingSystem
             };
             return(Response.AsJson(operatingSystemOutput));
         }
         catch (Exception e)
         {
             return(HttpStatusCode.InternalServerError);
         }
     };
 }
Exemple #4
0
 public OperatingSystemEndpoint(IOperatingSystemProcessor operatingSystemProcessor)
 {
     GetOperatingSystem(operatingSystemProcessor);
 }