コード例 #1
0
        public Switch()
        {
#if DEBUG_IN_EXTERNAL_APP
            MessageBox.Show("Attach debugger now");
#endif
            HandleAssemblyResolveEvents();
            device       = CompositionRoot.GetDeviceLayer();
            idOutOfRange = new InvalidValueException($"The switch ID must be in the range 0 .. {MaxSwitch-1}");
        }
コード例 #2
0
        public static DeviceLayer GetDeviceLayer()
        {
            Log.Info("Composing device layer from connection string: {0}", Settings.Default.ConnectionString);
            var endpoint = DeviceEndpoint.FromConnectionString(Settings.Default.ConnectionString);
            var channel  = GetChannelFromEndpoint(endpoint);
            var device   = new DeviceLayer(channel);

            return(device);
        }