private List <PluginTypeInfo> GetPluginsToRegister(PluginAssemblyInfo assemblyInfo) { List <PluginTypeInfo> pluginsToRegister = new List <PluginTypeInfo>(); if (Plugins == null || Plugins.Length == 0) { pluginsToRegister.AddRange(assemblyInfo.Plugins); } else { foreach (string pluginName in Plugins) { PluginTypeInfo tempPluginType = assemblyInfo.Plugins.SingleOrDefault(p => p.TypeName.Equals(pluginName, StringComparison.InvariantCultureIgnoreCase) || p.PluginId != Guid.Empty); if (tempPluginType == null) { throw new Exception(string.Format("No Plugin named '{0}' found in assembly '{1}'.", pluginName, assemblyInfo.Name)); } else { pluginsToRegister.Add(tempPluginType); } } } return(pluginsToRegister); }
static StandardPlugins() { DefaultProducerList = new[] { #if DotNetCoreClrLinux StandardPluginTypes.LttProducer, #else StandardPluginTypes.EtlFileProducer, StandardPluginTypes.EtlInMemoryProducer, #if !DotNetCoreClrIOT StandardPluginTypes.PerfCounterConfigReader, #endif #endif StandardPluginTypes.FolderProducer }; consumers = new Dictionary <string, PluginTypeInfo>(); Dictionary <string, Type> consumerTypes = InitializeConsumerTypes(); Utility.TraceSource.WriteInfo( EventType, "Found following consumer types available: {0}.", string.Join(", ", consumerTypes.Keys)); foreach (string consumerName in consumerTypes.Keys) { Consumers[consumerName] = new PluginTypeInfo( consumerTypes[consumerName].GetTypeInfo().Assembly.FullName, consumerTypes[consumerName].FullName); } }
private Entity GenerateCrmEntity(Guid assemblyId, PluginTypeInfo pluginTypeInfo) { Entity crmPluginType = new Entity("plugintype") { Id = pluginTypeInfo.PluginId, Attributes = new AttributeCollection() }; crmPluginType.Attributes.Add("pluginassemblyid", new EntityReference("pluginassembly", assemblyId)); crmPluginType.Attributes.Add("typename", pluginTypeInfo.TypeName); crmPluginType.Attributes.Add("friendlyname", pluginTypeInfo.TypeName); crmPluginType.Attributes.Add("name", pluginTypeInfo.Name); if (pluginTypeInfo.PluginType == CrmPluginType.WorkflowActivity) { crmPluginType.Attributes.Add("workflowactivitygroupname", pluginTypeInfo.WorkflowActivityGroupName); } return(crmPluginType); }