コード例 #1
0
        /// <summary>
        /// Returns the plugin info by prefix. returns false if not containing
        /// </summary>
        /// <param name="pmd">The database that is cached</param>
        /// <param name="prefix">The prefix to be searched for</param>
        /// <param name="val">the out variable containing the plugin information(null if not found)</param>
        /// <returns>the success state of the operation</returns>
        public static bool TryGetPluginInfoByPrefix(PluginManagerDatabase pmd, string prefix, out PluginInformation val)
        {
            for (int i = 0; i < pmd.Cache.Count; i++)
            {
                if (pmd.Cache[i].Prefixes.Contains(prefix))
                {
                    val = pmd.Cache[i];
                    return(true);
                }
            }


            val = new PluginInformation();
            return(false);
        }
コード例 #2
0
        /// <summary>
        /// Returns the plugin info by name. returns false if not containing
        /// </summary>
        /// <param name="pmd">The database that is cached</param>
        /// <param name="name">the name to be searched for</param>
        /// <param name="val">the out variable containing the plugin information(null if not found)</param>
        /// <returns>the success state of the operation</returns>
        public static bool TryGetPluginInfoByName(PluginManagerDatabase pmd, string name, out PluginInformation val)
        {
            for (int i = 0; i < pmd.Cache.Count; i++)
            {
                if (pmd.Cache[i].Name == name)
                {
                    val = pmd.Cache[i];
                    return(true);
                }
            }


            val = new PluginInformation();
            return(false);
        }