コード例 #1
0
ファイル: CpuTempMonitor.cs プロジェクト: rnadna1/WinHue
 public CpuTempMonitor(Bridge bridge)
 {
     _bridge             = bridge;
     Temp                = new CpuTemp(1);
     Temp.OnTempUpdated += temp_OnTempUpdated;
     LoadSettings();
 }
コード例 #2
0
        public void Initialize(CpuTemp temp)
        {
            _temp = temp;
            _temp.OnTempUpdated   += _temp_OnTempUpdated;
            _temp.OnSensorUpdated += _temp_OnSensorUpdated;
            _temp.Start();

            List <IHueObject> hr = BridgesManager.Instance.SelectedBridge.GetAllObjects();

            if (hr == null)
            {
                return;
            }
            ListLightGroups.AddRange(hr.Where(x => x is Light));
            ListLightGroups.AddRange(hr.Where(x => x is Group));

            SelectedObject = Properties.Settings.Default.CPUTemp_ObjectID != "" ? ListLightGroups.Find(x => x.Id == Properties.Settings.Default.CPUTemp_ObjectID) : ListLightGroups[0];
        }
コード例 #3
0
        public void Initialize(Bridge bridge, CpuTemp temp)
        {
            _bridge                = bridge;
            _temp                  = temp;
            _temp.OnTempUpdated   += _temp_OnTempUpdated;
            _temp.OnSensorUpdated += _temp_OnSensorUpdated;
            _temp.Start();

            List <IHueObject> hr = HueObjectHelper.GetBridgeDataStore(_bridge);

            if (hr == null)
            {
                return;
            }
            ListLightGroups.AddRange(hr.Where(x => x is Light));
            ListLightGroups.AddRange(hr.Where(x => x is Group));

            SelectedObject = Properties.Settings.Default.CPUTemp_ObjectID != "" ? ListLightGroups.Find(x => x.Id == Properties.Settings.Default.CPUTemp_ObjectID) : ListLightGroups[0];
        }
コード例 #4
0
ファイル: SettingsForm.xaml.cs プロジェクト: menghang/WinHue
        /// <summary>
        /// The Host provides a way to request information on objects present in the bridge.
        /// </summary


        //*********************** Local Plugin Variable *********************

        public Form_CpuTempMonitorSettings(CpuTemp temp, Bridge bridge)
        {
            InitializeComponent();
            _cpuvm = DataContext as CpuTempViewModel;
            _cpuvm.Initialize(bridge, temp);
        }