public OperationalService(ICommandTransport transport, bool forwardPackets, bool listenPackets) { if (transport == null) { throw new ArgumentNullException("transport"); } if (forwardPackets || listenPackets) { InitializePacketForwarding(listenPackets, forwardPackets); } // don't really need to initialize anything if (Settings.TestMode) { helper = new TestHelper(); CommBuilder.BindObject(OperationalTestComponentFacade.ServiceName, helper); } else { CommBuilder.BindObject(OperationalFacade.ServiceName, this); } // set up the car mode channel carModeChannel = CommBuilder.GetChannel(CarModeChannelName); // register to receive run mode events transport.CarModeChanged += new EventHandler <CarModeChangedEventArgs>(transport_CarModeChanged); // mark that we haven't started yet started = false; }
public UIService() { if (Services.Dataset == null) { throw new InvalidOperationException("Dataset must be initialized before creating UIService"); } if (Services.Params == null) { throw new InvalidOperationException("TunableParameterTable must be intialized before creating UIService"); } datasetFacade = new DatasetSourceFacade(Services.Dataset); paramFacade = new TunableParameterFacade(Services.Params); // list in the object directory if (!Settings.TestMode) { CommBuilder.BindObject(OperationalUIFacade.ServiceName, this); } }