Beispiel #1
0
        public override void InformAttributeAdded(string attributeSetName, string?attributeName)
        {
            var attr = _client?.Attribute <string>(attributeSetName, attributeName);

            Logger.Debug($"APP: Attribute Set {attributeSetName} Attribute Added: {attributeName} Value: {attr?.Value}");
            if (_localNode.Id.Value == 1)
            {
                _client?.Replace("fake.set", "fake.attribute.name1", "value-replaced-2");
                _client?.Replace("fake.set", "fake.attribute.name2", "value-replaced-20");
            }
        }
        private void UnpublishService(string name)
        {
            _publisher.Send(RawMessage.From(0, 0, ServiceUnregistered.As(Named(_unregisteredServiceNamePrefix, name)).ToString()));

            var unregisteredNotificationsCount = _attributesClient.Attribute <int>(name, _unregisteredCount);
            var count = unregisteredNotificationsCount.Value - 1;

            if (count - 1 <= 0)
            {
                _attributesClient.RemoveAll(name);
            }
            else
            {
                _attributesClient.Replace(name, _unregisteredCount, count);
            }
        }