コード例 #1
0
        public void Connect()
        {
            string ipAddress  = ConfigurationManager.AppSettings["IpAddress"];
            int    portNumber = Int32.Parse(ConfigurationManager.AppSettings["PortNumber"]);

            try
            {
                messageClient.Start(ipAddress, portNumber);

                //messageClient.SubscribeToTraffic(Devices.WINDOWS_PHONE, Devices.RASPBERRY_B);
                //messageClient.SubscribeToTraffic(Devices.WINDOWS_PHONE, Devices.NETDUINO_3_WIFI);
                //messageClient.SubscribeToTraffic(Devices.WINDOWS_PHONE, Devices.NETDUINO_3_WIFI);
                messageClient.SubscribeToTraffic(Devices.WINDOWS_PHONE, Devices.NETDUINO_3_WIFI);
                //messageClient.SubscribeToTraffic(Devices.WINDOWS_PHONE, Devices.WINDOWS_CONSOLE);

                //PibrellaViewModel.Subscribe();
                //LEDsViewModel.Subscribe();
                //DataGeneratorViewModel.Subscribe();
                //DS18B20ViewModel.Subscribe();
                MCP4921ViewModel.Subscribe();

                Connected = true;
            }
            catch (Exception)
            {
                Connected = false;
            }
        }
コード例 #2
0
        public MainWindowViewModel()
        {
            messageClient = new MessageClient(Devices.WPF_MONITOR, HEARTBEAT_PERIOD_IN_MILLESECONDS);
            App.Current.Resources.Add("MessageClient", messageClient);

            PibrellaViewModel      = new PibrellaViewModel();
            LEDsViewModel          = new LEDsViewModel();
            DataGeneratorViewModel = new DataGeneratorViewModel();
            DS18B20ViewModel       = new DS18B20ViewModel();
            MCP4921ViewModel       = new MCP4921ViewModel();
        }