예제 #1
0
        private void _rpc_OnMetadataUpdated(RPCController sender, Int32 peerID, MetadataVariable value)
        {
            if (_disposing)
            {
                return;
            }
            if (!Devices.ContainsKey(peerID))
            {
                if (ReloadRequired != null)
                {
                    ReloadRequired(this, ReloadType.Full);
                }
                return;
            }
            Device device = Devices[peerID];

            if (!device.Metadata.ContainsKey(value.Name))
            {
                if (DeviceReloadRequired != null)
                {
                    DeviceReloadRequired(this, device, null, DeviceReloadType.Metadata);
                }
                return;
            }
            MetadataVariable variable = device.Metadata[value.Name];

            variable.SetValue(value);
            if (MetadataUpdated != null)
            {
                MetadataUpdated(this, device, variable);
            }
        }
예제 #2
0
        private void _rpc_OnMetadataUpdated(RPCController sender, long peerId, MetadataVariable value)
        {
            if (_disposing)
            {
                return;
            }

            if (!Devices.ContainsKey(peerId))
            {
                ReloadRequired?.Invoke(this, ReloadType.Full);
                return;
            }
            Device device = Devices[peerId];

            if (!device.Metadata.ContainsKey(value.Name))
            {
                DeviceReloadRequired?.Invoke(this, device, null, DeviceReloadType.Metadata);
                return;
            }
            MetadataVariable variable = device.Metadata[value.Name];

            variable.SetValue(value);
            MetadataUpdated?.Invoke(this, device, variable);
        }