Ejemplo n.º 1
0
        public void LoadServices()
        {
            var names = PluginServiceProvider.GetServiceNames();

            foreach (var name in names)
            {
                var item = new ListItem
                {
                    Text = name,
                    Tag  = PluginServiceProvider.GetServiceStore(name)
                };
                _comboBoxServices.Items.Add(item);
            }
        }
Ejemplo n.º 2
0
        private void LoadServicesInUi()
        {
            var serviceNames = PluginServiceProvider.GetServiceNames().ToList();

            if (serviceNames.Any())
            {
                foreach (var name in serviceNames)
                {
                    var serviceType = PluginServiceProvider.GetServiceTypeName(name);
                    var provider    = PluginServiceProvider.GetServiceProvider(name);
                    var text        = string.Format(
                        "[Provider:{0}] [Type:{1}] {2}",
                        provider != null ? provider.PluginInfo.Name : "",
                        serviceType,
                        name);
                    _servicesMenuItem.Items.Add(new ButtonMenuItem {
                        Text = text
                    });
                }
            }
        }