Esempio n. 1
0
        public static string Moniker(this OfficialPlugin plugin)
        {
            var info = typeof(OfficialPlugin).GetField(plugin.ToString());
            var da   = info.GetCustomAttribute <MonikerAttribute>();

            if (da == null)
            {
                throw new InvalidOperationException($"{plugin} plugin must have a {nameof(MonikerAttribute)}");
            }
            return(da.Moniker);
        }
Esempio n. 2
0
 public ElasticsearchPlugin(OfficialPlugin plugin, Func <ElasticsearchVersion, bool> validForVersion = null)
 {
     this._plugin          = plugin;
     this._validForVersion = validForVersion;
     this.Moniker          = plugin.Moniker();
 }