public FeedPage(int SelectedWorld) { this.worldId = SelectedWorld; fR = new FacilityResolver(); subscribedMessages.CollectionChanged += SubscribedMessages_CollectionChanged; InitializeComponent(); planetsideService = new PlanetsideService(serviceID); planetsideService.MetagameEventChange += PlanetsideService_MetagameEventChangedAsync; planetsideService.ConnectionStateChanged += PlanetsideService_ConnectionStateChanged; planetsideService.FacilityControlChanged += PlanetsideService_FacilityControlChanged; consoleOut.ItemsSource = subscribedMessages; consoleOut.ItemAppearing += ConsoleOut_ItemAppearing; }
public int Run() { MachineStatusResult programResult = null; try { var facility = FacilityResolver.CreateFacility(); var systemMonitor = new SystemMonitor(facility); var status = systemMonitor.GetSystemStatus(); programResult = new MachineStatusResult(status); var processor = new JsonAssertionProcessor(programResult); foreach (var expectation in Expectations.Select(x => Expectation.Parse(x))) { var expectationResult = processor.Assert(expectation); if (expectationResult.Failed) { programResult.AddErrors(expectationResult.Errors); } } } catch (Exception ex) { programResult = MachineStatusResult.Failure(ex); } finally { var formating = Format ? Formatting.Indented : Formatting.None; System.Console.WriteLine(JsonConvert.SerializeObject(programResult, formating, serializerSettings)); } if (programResult == null || programResult.Error) { return(1); } else { return(0); } }