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;
		}
Ejemplo n.º 3
0
 public BuildSearchIndexesCommand(ITpBus bus, IProfileCollection profileCollection, IPluginContext pluginContext, IPluginMetadata pluginMetadata)
 {
     _bus = bus;
     _profileCollection = profileCollection;
     _pluginContext     = pluginContext;
     _pluginMetadata    = pluginMetadata;
 }
Ejemplo n.º 4
0
        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 ProfileRepository(IProfilePersister profilePersister, IProfileStoragePersister profileStoragePersister, IPluginMetadata pluginMetadata, IEventAggregator eventAggregator)
		{
			_profilePersister = profilePersister;
			_profileStoragePersister = profileStoragePersister;
			_pluginMetadata = pluginMetadata;
			_eventAggregator = eventAggregator;
		}
Ejemplo n.º 6
0
 public CheckIntervalElapsedMessageHandler(IBus bus, IPluginMetadata pluginMetadata, IAccountCollection collection, IMsmqTransport transport, ITaskFactory taskFactory)
 {
     _bus            = bus;
     _pluginMetadata = pluginMetadata;
     _collection     = collection;
     _transport      = transport;
     _taskFactory    = taskFactory;
 }
Ejemplo n.º 7
0
 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>();
		}
Ejemplo n.º 10
0
 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);
			}
		}
Ejemplo n.º 12
0
 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;
 }
Ejemplo n.º 14
0
        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;
        }
Ejemplo n.º 15
0
        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);
            }
        }
 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;
 }
Ejemplo n.º 17
0
        public PluginItem(IPluginMetadata info)
        {
            InitializeComponent();
            Debug.Assert(info != null);

            SuspendLayout();

            _model = DesignMode ? new DummyMetadata() : info;
            InitializeModel();

            ResumeLayout(true);
        }
Ejemplo n.º 18
0
 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);
        }
Ejemplo n.º 20
0
        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)));
        }
Ejemplo n.º 21
0
        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;
        }
Ejemplo n.º 23
0
 public ICollection <Guid> FindConflicts(IPluginMetadata plugin)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 24
0
 public ICollection <Guid> FindMissingDependencies(IPluginMetadata plugin)
 {
     throw new NotImplementedException();
 }
 public PluginContext(IBus bus, IPluginMetadata pluginMetadata)
 {
     _bus            = bus;
     _pluginMetadata = pluginMetadata;
 }
Ejemplo n.º 26
0
 public PluginRuntime AddPlugin(IPluginMetadata pluginMetadata)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 27
0
 public ExtensionDescriptor(PluginKey key, IPluginMetadata metadata, Type type)
     : base(key, metadata)
 {
     _type = type;
 }
Ejemplo n.º 28
0
 public AutomapVcsToTpUsersCommand(IPluginMetadata pluginMetadata, IVersionControlSystemFactory vcsFactory)
 {
     _pluginMetadata = pluginMetadata;
     _vcsFactory     = vcsFactory;
 }
Ejemplo n.º 29
0
        internal Plugin(IPluginMetadata rpMetadata)
        {
            r_Metadata = rpMetadata;

            ID = Guid.Parse(rpMetadata.Guid);
        }
Ejemplo n.º 30
0
        /// <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;
		}
Ejemplo n.º 32
0
        internal Plugin(IPluginMetadata rpMetadata)
        {
            r_Metadata = rpMetadata;

            ID = Guid.Parse(rpMetadata.Guid);
        }
 protected EditProfileCommandBase(IProfileCollection profileCollection, ITpBus bus, IPluginContext pluginContext,
                                  IPluginMetadata pluginMetadata)
     : base(profileCollection, bus, pluginContext)
 {
     _pluginMetadata = pluginMetadata;
 }
Ejemplo n.º 34
0
 public int CompareTo(IPluginMetadata other) => this.compareTo(other);
Ejemplo n.º 35
0
 public FigureDescriptor(PluginKey key, IPluginMetadata metadata, Type type)
     : base(key, metadata)
 {
     _type = type;
 }
		public AutomapVcsToTpUsersCommand(IPluginMetadata pluginMetadata, IVersionControlSystemFactory vcsFactory)
		{
			_pluginMetadata = pluginMetadata;
			_vcsFactory = vcsFactory;
		}
 public PluginContext(IBus bus, IPluginMetadata pluginMetadata)
 {
     _bus = bus;
     _pluginMetadata = pluginMetadata;
 }
Ejemplo n.º 38
0
 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;
		}
Ejemplo n.º 41
0
 public DeleteProfileCommandHandler(ITpBus tpBus, IPluginMetadata pluginMetadata)
 {
     _tpBus          = tpBus;
     _pluginMetadata = pluginMetadata;
 }
Ejemplo n.º 42
0
    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;
    }
Ejemplo n.º 43
0
 public PluginDescriptor(PluginKey key, IPluginMetadata metadata)
 {
     Key      = key;
     Metadata = metadata;
 }
Ejemplo n.º 44
0
        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;
        }
Ejemplo n.º 45
0
 public PluginModel(Lazy <IPlugin, IPluginMetadata> settings)
 {
     _settings = settings.Value;
     _metadata = settings.Metadata;
 }
Ejemplo n.º 46
0
 public ProfilePersister(IDatabaseConfiguration configuration, IPluginMetadata pluginMetadata)
 {
     _configuration = configuration;
     _pluginName    = pluginMetadata.PluginData.Name;
 }
 internal FailureInfo(IPluginMetadata rpMetadata, Exception rpException)
 {
     Metadata = rpMetadata;
     ExceptionContent = rpException.ToString();
 }