public ProfileRepository(IProfilePersister profilePersister, IProfileStoragePersister profileStoragePersister, IPluginMetadata pluginMetadata, IEventAggregator eventAggregator) { _profilePersister = profilePersister; _profileStoragePersister = profileStoragePersister; _pluginMetadata = pluginMetadata; _eventAggregator = eventAggregator; }
public BuildSearchIndexesCommand(ITpBus bus, IProfileCollection profileCollection, IPluginContext pluginContext, IPluginMetadata pluginMetadata) { _bus = bus; _profileCollection = profileCollection; _pluginContext = pluginContext; _pluginMetadata = pluginMetadata; }
public static PluginIdentity GetIdentity(Type pluginType, IPluginMetadata metadata = null) { if (pluginType == null) { throw new ArgumentNullException("pluginType"); } PluginIdentity identity; if (_cache.TryGetValue(pluginType.FullName, out identity)) { return(identity); } if (metadata == null) { metadata = GetPluginMetadata(pluginType); } identity = GetIdentityCore(pluginType, metadata); _cache[pluginType.FullName] = identity; return(identity); }
public CheckIntervalElapsedMessageHandler(IBus bus, IPluginMetadata pluginMetadata, IAccountCollection collection, IMsmqTransport transport, ITaskFactory taskFactory) { _bus = bus; _pluginMetadata = pluginMetadata; _collection = collection; _transport = transport; _taskFactory = taskFactory; }
public RunAtStartStopInitializer() { _documentIndexProvider = ObjectFactory.GetInstance <IDocumentIndexProvider>(); _log = ObjectFactory.GetInstance <IActivityLogger>(); _profileCollection = ObjectFactory.GetInstance <IProfileCollection>(); _isOnSite = ObjectFactory.GetInstance <IMsmqTransport>().RoutableTransportMode == RoutableTransportMode.OnSite; _bus = ObjectFactory.GetInstance <ITpBus>(); _pluginContext = ObjectFactory.GetInstance <IPluginContext>(); _pluginMetadata = ObjectFactory.GetInstance <IPluginMetadata>(); }
protected PluginInfoSender() { _context = ObjectFactory.GetInstance<IPluginContext>(); _bus = ObjectFactory.GetInstance<ITpBus>(); PluginMetadata = ObjectFactory.GetInstance<IPluginMetadata>(); _accountCollection = ObjectFactory.GetInstance<IAccountCollection>(); _pluginQueueFactory = ObjectFactory.GetInstance<IPluginQueueFactory>(); _pluginSettings = ObjectFactory.GetInstance<IPluginSettings>(); _pluginIcon = ObjectFactory.GetInstance<PluginIcon>(); }
public RunAtStartStopInitializer() { _documentIndexProvider = ObjectFactory.GetInstance<IDocumentIndexProvider>(); _log = ObjectFactory.GetInstance <IActivityLogger>(); _profileCollection = ObjectFactory.GetInstance<IProfileCollection>(); _isOnSite = ObjectFactory.GetInstance<IMsmqTransport>().RoutableTransportMode == RoutableTransportMode.OnSite; _bus = ObjectFactory.GetInstance<ITpBus>(); _pluginContext = ObjectFactory.GetInstance<IPluginContext>(); _pluginMetadata = ObjectFactory.GetInstance<IPluginMetadata>(); }
public IPluginDescriptor GetDescriptor(string typeFullName, IPluginMetadata pluginMetadata, string assemblyPath) { return _ioc.Get<IPluginDescriptor>(new[] { new IOCConstructorArgument("typeFullName", typeFullName), new IOCConstructorArgument("metadata", pluginMetadata), new IOCConstructorArgument("assemblyPath", assemblyPath), }); }
public PluginIcon(IPluginMetadata pluginMetadata, IActivityLogger log) { _log = log; var iconFileRelativePath = pluginMetadata.PluginData.IconFilePath; if (!string.IsNullOrEmpty(iconFileRelativePath)) { _iconFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, pluginMetadata.PluginData.IconFilePath); } }
internal Plugin(IPluginMetadata metadata) { this.Id = new Guid(metadata.Guid); this.Metadata = new PluginMetadata { Title = metadata.Title, Description = metadata.Description, Version = metadata.Version, Author = metadata.Author, }; }
public DocumentIndexRebuilder(IDocumentIndexProvider documentIndexProvider, DocumentIndexSetup documentIndexSetup, ITpBus bus, IPluginContext pluginContext, IPluginMetadata pluginMetadata, IProfileCollection profileCollection, IProfile profile, IActivityLogger logger) { _documentIndexProvider = documentIndexProvider; _documentIndexSetup = documentIndexSetup; _bus = bus; _pluginContext = pluginContext; _pluginMetadata = pluginMetadata; _profileCollection = profileCollection; _profile = profile; _logger = logger; }
public PluginMetadata(IPluginMetadata reference, Assembly assembly) { var asmNameData = assembly.GetName(); this.Name = reference.Name ?? asmNameData.Name; this.Version = reference.Version ?? asmNameData.Version.ToString(); this.Description = reference.Description ?? assembly.GetCustomAttribute <AssemblyDescriptionAttribute>()?.Description; this.Author = reference.Author ?? assembly.GetCustomAttribute <AssemblyCompanyAttribute>()?.Company; this.Copyright = reference.Copyright ?? assembly.GetCustomAttribute <AssemblyCopyrightAttribute>()?.Copyright; this.Trademark = reference.Trademark ?? assembly.GetCustomAttribute <AssemblyTrademarkAttribute>()?.Trademark; }
public PluginItem(IPluginMetadata info) { InitializeComponent(); Debug.Assert(info != null); SuspendLayout(); _model = DesignMode ? new DummyMetadata() : info; InitializeModel(); ResumeLayout(true); }
private int compareTo(IPluginMetadata other) { return(( this.Copyright?.CompareTo(other?.Copyright) + this.System?.CompareTo(other?.System) + this.Package?.CompareTo(other?.Package) + this.Revision?.CompareTo(other?.Revision) + this.Author?.CompareTo(other?.Author) + this.Date?.CompareTo(other?.Date) + this.Notion?.CompareTo(other?.Notion) + this.AttributeLevel.CompareTo(other?.AttributeLevel) ) ?? 0); }
public IPlugin RegisterPlugin(string path, IPluginMetadata pluginMeta) { var entryPath = Path.Combine(path, pluginMeta.EntryPoint); // some sanity checks if (File.Exists(entryPath) == false) throw new FileNotFoundException("Entry point not found", entryPath); // determine loader type here (native assembly, or shell out) // @todo - add support for other languages via shell // default to native assembly var assembly = Assembly.LoadFile(entryPath); return RegisterAssembly(assembly, pluginMeta); }
private static PluginIdentity GetIdentityCore(Type pluginType, IPluginMetadata metadata) { if (metadata.Empty) { try { var info = pluginType.GetAssemblyInfo(); var attr = pluginType.Assembly.GetAttribute <GuidAttribute>(); var guid = new Guid(attr.Value); return(new PluginIdentity(info.ProductName, info.CompanyName, guid)); } catch (Exception ex) { throw new ApplicationException("Failed to load plugin identity from assembly.", ex); } } return(new PluginIdentity(metadata.Name, metadata.Author, new Guid(metadata.Guid))); }
private static void Main() { var pluginLoader = new PluginLoader(AppDomain.CurrentDomain.BaseDirectory); pluginLoader.ExportsChanged += PluginLoaderOnExportsChanged; var plugins = pluginLoader.Plugins; var pluginsWithMetadata = pluginLoader.PluginsWithMetadata; foreach (var pluginWithMetadata in pluginsWithMetadata) { IPluginMetadata metadata = pluginWithMetadata.Metadata; ISortablePlugin sortService = pluginWithMetadata.Value; var sortedArray = sortService.Sort((int[])Data.Clone()); Console.WriteLine($"Name: {metadata.Name}"); Console.WriteLine($"Results: {string.Join(", ", sortedArray)}"); } }
/** .NET Native Binary Support - validate an assembly and loads its plugin implementation **/ private IPlugin RegisterAssembly(Assembly assembly, IPluginMetadata pluginMeta) { IPlugin pluginInstance; var pluginType = assembly.GetTypes()? .FirstOrDefault(x => typeof(IPlugin).IsAssignableFrom(x) && x.IsClass); // must be a matching type within the assembly if (pluginType == null) throw new RegistrationException($"Plugin type implementing IPlugin not found within the assembly {assembly}"); try { pluginInstance = (IPlugin) Activator.CreateInstance(pluginType); pluginInstance.MetaData = pluginMeta; } catch (Exception ex) { throw new RegistrationException($"Error registering plugin from assembly {assembly}", ex); } return pluginInstance; }
public ICollection <Guid> FindConflicts(IPluginMetadata plugin) { throw new NotImplementedException(); }
public ICollection <Guid> FindMissingDependencies(IPluginMetadata plugin) { throw new NotImplementedException(); }
public PluginContext(IBus bus, IPluginMetadata pluginMetadata) { _bus = bus; _pluginMetadata = pluginMetadata; }
public PluginRuntime AddPlugin(IPluginMetadata pluginMetadata) { throw new NotImplementedException(); }
public ExtensionDescriptor(PluginKey key, IPluginMetadata metadata, Type type) : base(key, metadata) { _type = type; }
public AutomapVcsToTpUsersCommand(IPluginMetadata pluginMetadata, IVersionControlSystemFactory vcsFactory) { _pluginMetadata = pluginMetadata; _vcsFactory = vcsFactory; }
internal Plugin(IPluginMetadata rpMetadata) { r_Metadata = rpMetadata; ID = Guid.Parse(rpMetadata.Guid); }
/// <summary> /// If the class implements the ExportJarsPlugin (or inherited from) attribute, this function will extract the name of the plugin given in the Attribute. /// </summary> /// <returns></returns> public static string GetPluginTextFromAttributeValue(this IPluginBase plugin) { IPluginMetadata attribute = plugin.GetType().GetCustomAttributes <ExportPluginAttribute>(false).FirstOrDefault(); return((attribute != null) ? attribute.PluginText : plugin.GetType().Name); }
protected EditProfileCommandBase(IProfileCollection profileCollection, ITpBus bus, IPluginContext pluginContext, IPluginMetadata pluginMetadata) : base(profileCollection, bus, pluginContext) { _pluginMetadata = pluginMetadata; }
public int CompareTo(IPluginMetadata other) => this.compareTo(other);
public FigureDescriptor(PluginKey key, IPluginMetadata metadata, Type type) : base(key, metadata) { _type = type; }
public AddProfileCommand(ITpBus bus, IProfileCollection profileCollection, IPluginContext pluginContext, IPluginMetadata pluginMetadata) : base(profileCollection, bus, pluginContext, pluginMetadata) { }
public AddOrUpdateProfileCommand(ITpBus bus, IProfileCollection profileCollection, IPluginContext pluginContext, IPluginMetadata pluginMetadata) : base(profileCollection, bus, pluginContext, pluginMetadata) { _profileCollection = profileCollection; }
public PluginPersister(IDatabaseConfiguration configuration, IPluginMetadata pluginMetadata) { _configuration = configuration; _pluginName = pluginMetadata.PluginData.Name; }
public DeleteProfileCommandHandler(ITpBus tpBus, IPluginMetadata pluginMetadata) { _tpBus = tpBus; _pluginMetadata = pluginMetadata; }
protected ICollection<PluginRuntime> _dependentPlugins = null; // Lazy initialized #endregion #region Ctor /// <summary> /// Creates a new plugin runtime data structure for the specified plugin metadata /// instance. /// </summary> /// <param name="metaData">The metadata of the plugin to create this runtime structure for.</param> /// <param name="syncObj">The object to synchronize multithreading access.</param> internal PluginRuntime(IPluginMetadata metaData, object syncObj) { _syncObj = syncObj; _pluginMetadata = metaData; _state = PluginState.Available; }
public PluginDescriptor(PluginKey key, IPluginMetadata metadata) { Key = key; Metadata = metadata; }
protected ICollection <PluginRuntime> _dependentPlugins = null; // Lazy initialized #endregion #region Ctor /// <summary> /// Creates a new plugin runtime data structure for the specified plugin metadata /// instance. /// </summary> /// <param name="metaData">The metadata of the plugin to create this runtime structure for.</param> /// <param name="syncObj">The object to synchronize multithreading access.</param> internal PluginRuntime(IPluginMetadata metaData, object syncObj) { _syncObj = syncObj; _pluginMetadata = metaData; _state = PluginState.Available; }
public PluginModel(Lazy <IPlugin, IPluginMetadata> settings) { _settings = settings.Value; _metadata = settings.Metadata; }
public ProfilePersister(IDatabaseConfiguration configuration, IPluginMetadata pluginMetadata) { _configuration = configuration; _pluginName = pluginMetadata.PluginData.Name; }
internal FailureInfo(IPluginMetadata rpMetadata, Exception rpException) { Metadata = rpMetadata; ExceptionContent = rpException.ToString(); }