/// <summary> /// Initializes a new instance of the <see cref="Brick"/> class. /// </summary> /// <param name="communicationFactory">Object implementing the <see cref="ICommunicationFactory"/> interface.</param> /// <param name="fileProvider">Object implementing the <see cref="IFileProvider"/> interface.</param> /// <param name="alwaysSendEvents">Send events when data changes, or at every poll</param> public Brick(ICommunicationFactory communicationFactory, IFileProvider fileProvider, bool alwaysSendEvents = false) { DirectCommandFactory = new DirectCommandFactory(this); SystemCommandFactory = new SystemCommandFactory(this, fileProvider); BatchCommandFactory = new BatchCommandFactory(this); Buttons = new BrickButtons(); _communicationFactory = communicationFactory; _alwaysSendEvents = alwaysSendEvents; int index = 0; Ports = new Dictionary <InputPort, Port>(); foreach (InputPort i in Enum.GetValues(typeof(InputPort))) { Ports[i] = new Port { InputPort = i, Index = index++, Name = i.ToString(), }; } }
/// <summary> /// Initializes a new instance of the <see cref="ChannelBase"/> class using the given communication factory implementation. /// </summary> /// <param name="communicationFactory">The communication factory that is used to create the actual communication objects.</param> protected ChannelBase(ICommunicationFactory communicationFactory) { if (communicationFactory == null) { throw new ArgumentNullException("communicationFactory"); } CommunicationFactory = communicationFactory; }
/// <summary> /// Initializes a new instance of the <see cref="PhoneControllerClient"/> class. /// </summary> /// <param name="dataSource">The data source used to acquire data.</param> /// <param name="communicationFactory">The communication factory used to create the actual communication objects.</param> public PhoneControllerClient(IDataSource dataSource, ICommunicationFactory communicationFactory) { if (communicationFactory == null) { throw new ArgumentNullException("communicationFactory"); } _communicationFactory = communicationFactory; CreatePhoneControllerClient(dataSource); }
/// <summary> /// Initializes a new instance of the <see cref="PhoneControllerServer"/> class using the given communication factory. /// </summary> /// <param name="communicationFactory">The communication factory used to create the interal communication objects.</param> public PhoneControllerServer(ICommunicationFactory communicationFactory) { if (communicationFactory == null) { throw new ArgumentNullException("communicationFactory"); } _communicationFactory = communicationFactory; CreatePhoneControllerServer(); }
/// <summary> /// Initializes a new instance of the <see cref="PhoneControllerClient"/> class using the given data source. /// </summary> /// <param name="dataSource">The data source used to acquire data.</param> public PhoneControllerClient(IDataSource dataSource) { _communicationFactory = new DefaultCommunicationFactory(); CreatePhoneControllerClient(dataSource); }
/// <summary> /// Initializes a new instance of the <see cref="ControlChannel"/> class using the given communication factory. /// </summary> /// <param name="communicationFactory">The communication factory used to create the actual communication objects.</param> public ControlChannel(ICommunicationFactory communicationFactory) : base(communicationFactory) { }
/// <summary> /// Initializes a new instance of the <see cref="DataChannel"/> class using the given communication factory. /// </summary> /// <param name="communicationFactory">The communication factory that is used to create the actual communication objects.</param> public DataChannel(ICommunicationFactory communicationFactory) : base(communicationFactory) { }
/// <summary> /// Initializes a new instance of the <see cref="PhoneControllerServer"/> class. /// </summary> public PhoneControllerServer() { _communicationFactory = new DefaultCommunicationFactory(); CreatePhoneControllerServer(); }