void UpdateStatusFromPowerBar(PowerBarItem powerBar)
        {
            if (powerBar.Shading > MaxShading)
            {
                MaxShading = powerBar.Shading;
            }
            if (powerBar.Shading < MinShading)
            {
                MinShading = powerBar.Shading;
            }

            if (powerBar.RealBrightness > MaxRealBrightness)
            {
                MaxRealBrightness = powerBar.RealBrightness;
            }
            if (powerBar.RealBrightness < MinRealBrightness)
            {
                MinRealBrightness = powerBar.RealBrightness;
            }

            if (powerBar.UserBrightness > MaxUserBrightness)
            {
                MaxUserBrightness = powerBar.UserBrightness;
            }
            if (powerBar.UserBrightness < MinUserBrightness)
            {
                MinUserBrightness = powerBar.UserBrightness;
            }

            if (ModeID != powerBar.ModeID)
            {
                ModeID = -1;
            }
        }
        void InitStatusFromPowerBar(PowerBarItem powerBar)
        {
            ModeID = powerBar.ModeID;

            MaxShading = powerBar.Shading;
            MinShading = powerBar.Shading;

            MaxRealBrightness = powerBar.RealBrightness;
            MinRealBrightness = powerBar.RealBrightness;

            MaxUserBrightness = powerBar.UserBrightness;
            MinUserBrightness = powerBar.UserBrightness;
        }
Exemple #3
0
        public void AddPowerBars(List <PowerBar> powerBars)
        {
            foreach (var group in powerBars)
            {
                var item = new PowerBarItem(group);

                if (AllPowerBars == null)
                {
                    AllPowerBars = new List <PowerBarItem>();
                }
                AllPowerBars.Add(item);

                if (group.Groups != null && group.Groups.Any())
                {
                    foreach (var parent in group.Groups)
                    {
                        var parentItem = _groupsByID[parent.GroupID];
                        if (parentItem.PowerBars == null)
                        {
                            parentItem.PowerBars = new List <PowerBarItem>();
                        }
                        parentItem.PowerBars.Add(item);
                        if (item.Groups == null)
                        {
                            item.Groups = new List <GroupItem>();
                        }
                        item.Groups.Add(parentItem);
                    }
                }
                else
                {
                    if (PowerBars == null)
                    {
                        PowerBars = new List <PowerBarItem>();
                    }
                    PowerBars.Add(item);
                }
            }
        }