void ExpandArea(TreeNode node, API.Area pArea)
        {
            Luminaire[] lums = PhilipsRestApi.GetLuminerLevels(pArea);

            foreach (Luminaire lum in lums)
            {
                TreeNode nd = new TreeNode(lum.luminaireID.ToString());
                nd.Tag = lum;
                node.Nodes.Add(nd);
            }
        }
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            //this.propertyGrid1.SelectedObject = e.Node.Tag;

            if (e.Node.Tag == null)
            {
                return;
            }

            if (e.Node.Tag is API.Area)
            {
                API.Area area = e.Node.Tag as API.Area;
                this.txtArea.Text       = area.areaID.ToString();
                this.txt_Luminaire.Text = "";

                this.groupBox1.Visible = true;
                if (e.Node.Nodes.Count == 0)
                {
                    ExpandArea(e.Node, e.Node.Tag as API.Area);
                }

                cmb_AreaOff.Items.Clear();
                cmb_AreaOn.Items.Clear();
                AreaLevel[] levels = PhilipsRestApi.GetAreaLevels(area.areaID);
                foreach (AreaLevel lvl in levels)
                {
                    cmb_AreaOff.Items.Add(lvl);
                    cmb_AreaOn.Items.Add(lvl);
                }
            }
            else if (e.Node.Tag is Luminaire)
            {
                this.groupBox1.Visible = false;
                Luminaire lum  = e.Node.Tag as Luminaire;
                API.Area  area = e.Node.Parent.Tag as API.Area;
                this.txtArea.Text       = area.areaID.ToString();
                this.txt_Luminaire.Text = lum.luminaireID.ToString();
            }
        }