Ejemplo n.º 1
0
        public House(bool online)
        {
            m_zwaveWrapper = new Wrapper(online ? Mode.Online : Mode.Offline);

            foreach (IZWaveDevice device in m_zwaveWrapper.Controller.Devices)
            {
                if (device is IBinarySceneSwitch)
                {
                    m_devices.Add(new BinaryLight(device as IBinarySceneSwitch));
                }
            }

            if (online)
            {
                m_devices.Add(new OfficeJet6500("OfficeJet6500"));
            }
        }
        public MainWindow()
        {
            Console.WriteLine("in main window");
            InitializeComponent();

            try
            {
                foreach (string assembly in settings.AssembliesToLoad)
                {
                    adapterLoader.LoadAdapters(assembly);
                }
                Wrapper = new ZWaveWrappers.Wrapper(Mode.Online);
                m_buttonHandler = new ButtonHandler(Wrapper.Controller.Devices);

                Devices.ItemsSource = Wrapper.Controller.Devices;
                Mappings.ItemsSource = m_buttonHandler.Mappings;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }