Esempio n. 1
0
        public IReadOnlyList <PluginIdentifier> FindAllPluginsFor(IReadOnlyList <PluginInterface> interfaces)
        {
            var stopwatch = Stopwatch.StartNew();

            Log.DebugFormat("Retrieving all plugins compatible to '{0}'...", string.Join(", ", interfaces));

            var interfacesByName = CreateInterfaceMap(interfaces);

            // TODO: Use proper indices when necessary...
            var plugins = new List <PluginIdentifier>();

            foreach (var pair in _pluginDescriptions.GetAll())
            {
                if (IsSupported(pair.Value, interfacesByName))
                {
                    plugins.Add(pair.Key);
                }
            }

            stopwatch.Stop();
            Log.InfoFormat("Found {0} plugins ({1}) (took {2}ms)", plugins.Count,
                           string.Join(", ", plugins),
                           stopwatch.ElapsedMilliseconds);

            return(plugins);
        }
Esempio n. 2
0
 public Task <IEnumerable <KeyValuePair <Guid, Device2> > > GetAllDevices()
 {
     return(_scheduler.StartNew(() => _devices.GetAll()));
 }
Esempio n. 3
0
 public Task <IEnumerable <KeyValuePair <Guid, Alarm> > > GetAllAlarms()
 {
     return(_scheduler.StartNew(() => _alarms.GetAll()));
 }