Exemple #1
0
        private CharacteristicsGroup GetGroup(int id)
        {
            CharacteristicsGroup result = null;

            foreach (CharacteristicsGroup group in _currentGroups)
            {
                if (group.GroupId == id)
                {
                    result = group;
                    break;
                }
            }
            return(result);
        }
Exemple #2
0
        public void ChangeOrCreate(ICharacteristic characteristic, int value, int id)
        {
            var group = GetGroup(id);

            if (group == null)
            {
                group = new CharacteristicsGroup()
                {
                    GroupId = id
                };
                group.Characteristics[characteristic] = value;
                _currentGroups.Add(group);
                CharacteristicChanged(group.GroupId, characteristic, group.Characteristics[characteristic]);
            }
            else
            {
                Change(characteristic, value, id);
            }
        }